Merge pull request #1667 from zcash/transparent-key-deriv-bugfix

transparent: Fix bugs in `AccountPubKey::derive_pubkey_at_bip32_path`
This commit is contained in:
Jack Grigg 2024-12-18 03:20:37 +13:00 committed by GitHub
commit 0255874a26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 648 additions and 240 deletions

View File

@ -7,6 +7,10 @@ and this library adheres to Rust's notion of
## [Unreleased]
### Fixed
- `zcash_transparent::keys::AccountPubKey::derive_pubkey_at_bip32_path` now
returns the correct result for valid paths instead of an error or panic.
## [0.1.0] - 2024-12-16
The entries below are relative to the `zcash_primitives` crate as of the tag

View File

@ -58,6 +58,10 @@ hex.workspace = true
# - Transparent protocol
ripemd.workspace = true
[dev-dependencies]
proptest.workspace = true
zcash_protocol = { workspace = true, features = ["test-dependencies"] }
[features]
default = ["std"]
std = [

View File

@ -273,17 +273,17 @@ impl AccountPubKey {
expected_account_index: AccountId,
path: &[ChildNumber],
) -> Result<secp256k1::PublicKey, bip32::Error> {
if path.len() > 3 {
if path.len() < 3 {
Err(bip32::Error::ChildNumber)
} else {
match path.split_at(3) {
(
[ChildNumber(44 | ChildNumber::HARDENED_FLAG), coin_type, account_index],
sub_path,
) if coin_type.is_hardened()
&& coin_type.index() == params.network_type().coin_type()
&& account_index.is_hardened()
&& account_index.index() == expected_account_index.into() =>
([purpose, coin_type, account_index], sub_path)
if purpose.is_hardened()
&& purpose.index() == 44
&& coin_type.is_hardened()
&& coin_type.index() == params.network_type().coin_type()
&& account_index.is_hardened()
&& account_index.index() == expected_account_index.into() =>
{
sub_path
.iter()
@ -522,244 +522,118 @@ impl ExternalOvk {
mod tests {
use bip32::ChildNumber;
use subtle::ConstantTimeEq;
use zcash_protocol::consensus::{NetworkConstants, MAIN_NETWORK};
use super::AccountPubKey;
use super::NonHardenedChildIndex;
#[allow(deprecated)]
use crate::keys::pubkey_to_address;
use crate::{
address::TransparentAddress,
keys::{AccountPrivKey, IncomingViewingKey, TransparentKeyScope},
test_vectors,
};
#[test]
#[allow(deprecated)]
fn address_derivation() {
let seed = [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
];
for account_index in 0..5 {
let account_index = zip32::AccountId::try_from(account_index).unwrap();
let account_sk =
AccountPrivKey::from_seed(&MAIN_NETWORK, &seed, account_index).unwrap();
let account_pubkey = account_sk.to_account_pubkey();
let external_ivk = account_pubkey.derive_external_ivk().unwrap();
let (address, address_index) = external_ivk.default_address();
let address_pubkey = account_pubkey
.derive_address_pubkey(TransparentKeyScope::EXTERNAL, address_index)
.unwrap();
assert_eq!(pubkey_to_address(&address_pubkey), address);
let expected_path = [
ChildNumber::new(44, true).unwrap(),
ChildNumber::new(MAIN_NETWORK.coin_type(), true).unwrap(),
ChildNumber::new(account_index.into(), true).unwrap(),
TransparentKeyScope::EXTERNAL.into(),
address_index.into(),
];
// For short paths, we get an error.
for i in 0..3 {
assert_eq!(
account_pubkey.derive_pubkey_at_bip32_path(
&MAIN_NETWORK,
account_index,
&expected_path[..i]
),
Err(bip32::Error::ChildNumber),
);
}
// The truncated-by-one path gives the external IVK.
assert_eq!(
account_pubkey.derive_pubkey_at_bip32_path(
&MAIN_NETWORK,
account_index,
&expected_path[..4],
),
Ok(*external_ivk.0.public_key()),
);
// The full path gives the correct pubkey.
assert_eq!(
account_pubkey.derive_pubkey_at_bip32_path(
&MAIN_NETWORK,
account_index,
&expected_path,
),
Ok(address_pubkey),
);
}
}
#[test]
#[allow(deprecated)]
fn bip_32_test_vectors() {
let seed = [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
];
for tv in test_vectors::bip_32() {
let account_sk = AccountPrivKey::from_seed(
&MAIN_NETWORK,
&seed,
zip32::AccountId::try_from(tv.account).unwrap(),
)
.unwrap();
let account_pubkey = account_sk.to_account_pubkey();
let mut key_bytes = [0u8; 65];
key_bytes[..32].copy_from_slice(&tv.c);
key_bytes[32..].copy_from_slice(&tv.pk);
assert_eq!(account_pubkey.serialize(), key_bytes);
let (internal_ovk, external_ovk) = account_pubkey.ovks_for_shielding();
assert_eq!(internal_ovk.as_bytes(), tv.internal_ovk);
assert_eq!(external_ovk.as_bytes(), tv.external_ovk);
// The test vectors are broken here: they should be deriving an address at the
// address level, but instead use the account pubkey as an address.
let address = TransparentAddress::PublicKeyHash(tv.address);
assert_eq!(pubkey_to_address(account_pubkey.0.public_key()), address);
}
}
#[test]
fn check_ovk_test_vectors() {
struct TestVector {
c: [u8; 32],
pk: [u8; 33],
external_ovk: [u8; 32],
internal_ovk: [u8; 32],
}
// From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/zip_0316.py
let test_vectors = vec![
TestVector {
c: [
0x5d, 0x7a, 0x8f, 0x73, 0x9a, 0x2d, 0x9e, 0x94, 0x5b, 0x0c, 0xe1, 0x52, 0xa8,
0x04, 0x9e, 0x29, 0x4c, 0x4d, 0x6e, 0x66, 0xb1, 0x64, 0x93, 0x9d, 0xaf, 0xfa,
0x2e, 0xf6, 0xee, 0x69, 0x21, 0x48,
],
pk: [
0x02, 0x16, 0x88, 0x4f, 0x1d, 0xbc, 0x92, 0x90, 0x89, 0xa4, 0x17, 0x6e, 0x84,
0x0b, 0xb5, 0x81, 0xc8, 0x0e, 0x16, 0xe9, 0xb1, 0xab, 0xd6, 0x54, 0xe6, 0x2c,
0x8b, 0x0b, 0x95, 0x70, 0x20, 0xb7, 0x48,
],
external_ovk: [
0xdc, 0xe7, 0xfb, 0x7f, 0x20, 0xeb, 0x77, 0x64, 0xd5, 0x12, 0x4f, 0xbd, 0x23,
0xc4, 0xd7, 0xca, 0x8c, 0x32, 0x19, 0xec, 0x1d, 0xb3, 0xff, 0x1e, 0x08, 0x13,
0x50, 0xad, 0x03, 0x9b, 0x40, 0x79,
],
internal_ovk: [
0x4d, 0x46, 0xc7, 0x14, 0xed, 0xda, 0xd9, 0x4a, 0x40, 0xac, 0x21, 0x28, 0x6a,
0xff, 0x32, 0x7d, 0x7e, 0xbf, 0x11, 0x9e, 0x86, 0x85, 0x10, 0x9b, 0x44, 0xe8,
0x02, 0x83, 0xd8, 0xc8, 0xa4, 0x00,
],
},
TestVector {
c: [
0xbf, 0x69, 0xb8, 0x25, 0x0c, 0x18, 0xef, 0x41, 0x29, 0x4c, 0xa9, 0x79, 0x93,
0xdb, 0x54, 0x6c, 0x1f, 0xe0, 0x1f, 0x7e, 0x9c, 0x8e, 0x36, 0xd6, 0xa5, 0xe2,
0x9d, 0x4e, 0x30, 0xa7, 0x35, 0x94,
],
pk: [
0x03, 0x72, 0x73, 0xb6, 0x57, 0xd9, 0x71, 0xa4, 0x5e, 0x72, 0x24, 0x0c, 0x7a,
0xaa, 0xa7, 0xd0, 0x68, 0x5d, 0x06, 0xd7, 0x99, 0x9b, 0x0a, 0x19, 0xc4, 0xce,
0xa3, 0x27, 0x88, 0xa6, 0xab, 0x51, 0x3d,
],
external_ovk: [
0x8d, 0x31, 0x53, 0x7b, 0x38, 0x8f, 0x40, 0x23, 0xe6, 0x48, 0x70, 0x8b, 0xfb,
0xde, 0x2b, 0xa1, 0xff, 0x1a, 0x4e, 0xe1, 0x12, 0xea, 0x67, 0x0a, 0xd1, 0x67,
0x44, 0xf4, 0x58, 0x3e, 0x95, 0x52,
],
internal_ovk: [
0x16, 0x77, 0x49, 0x00, 0x76, 0x9d, 0x9c, 0x03, 0xbe, 0x06, 0x32, 0x45, 0xcf,
0x1c, 0x22, 0x44, 0xa9, 0x2e, 0x48, 0x51, 0x01, 0x54, 0x73, 0x61, 0x3f, 0xbf,
0x38, 0xd2, 0x42, 0xd7, 0x54, 0xf6,
],
},
TestVector {
c: [
0x3d, 0xc1, 0x66, 0xd5, 0x6a, 0x1d, 0x62, 0xf5, 0xa8, 0xd7, 0x55, 0x1d, 0xb5,
0xfd, 0x93, 0x13, 0xe8, 0xc7, 0x20, 0x3d, 0x99, 0x6a, 0xf7, 0xd4, 0x77, 0x08,
0x37, 0x56, 0xd5, 0x9a, 0xf8, 0x0d,
],
pk: [
0x03, 0xec, 0x05, 0xbb, 0x7f, 0x06, 0x5e, 0x25, 0x6f, 0xf4, 0x54, 0xf8, 0xa8,
0xdf, 0x6f, 0x2f, 0x9b, 0x8a, 0x8c, 0x95, 0x08, 0xca, 0xac, 0xfe, 0xe9, 0x52,
0x1c, 0xbe, 0x68, 0x9d, 0xd1, 0x12, 0x0f,
],
external_ovk: [
0xdb, 0x97, 0x52, 0x0e, 0x2f, 0xe3, 0x68, 0xad, 0x50, 0x2d, 0xef, 0xf8, 0x42,
0xf0, 0xc0, 0xee, 0x5d, 0x20, 0x3b, 0x48, 0x33, 0x7a, 0x0f, 0xff, 0x75, 0xbe,
0x24, 0x52, 0x59, 0x77, 0xf3, 0x7e,
],
internal_ovk: [
0xbc, 0x4a, 0xcb, 0x5f, 0x52, 0xb8, 0xae, 0x21, 0xe3, 0x32, 0xb1, 0x7c, 0x29,
0x63, 0x1f, 0x68, 0xe9, 0x68, 0x2a, 0x46, 0xc4, 0xa7, 0xab, 0xc8, 0xed, 0xf9,
0x0d, 0x37, 0xae, 0xea, 0xd3, 0x6c,
],
},
TestVector {
c: [
0x49, 0x5c, 0x22, 0x2f, 0x7f, 0xba, 0x1e, 0x31, 0xde, 0xfa, 0x3d, 0x5a, 0x57,
0xef, 0xc2, 0xe1, 0xe9, 0xb0, 0x1a, 0x03, 0x55, 0x87, 0xd5, 0xfb, 0x1a, 0x38,
0xe0, 0x1d, 0x94, 0x90, 0x3d, 0x3c,
],
pk: [
0x02, 0x81, 0x8f, 0x50, 0xce, 0x47, 0x10, 0xf4, 0xeb, 0x11, 0xe7, 0x43, 0xe6,
0x40, 0x85, 0x44, 0xaa, 0x3c, 0x12, 0x3c, 0x7f, 0x07, 0xe2, 0xaa, 0xbb, 0x91,
0xaf, 0xc4, 0xec, 0x48, 0x78, 0x8d, 0xe9,
],
external_ovk: [
0xb8, 0xa3, 0x6d, 0x62, 0xa6, 0x3f, 0x69, 0x36, 0x7b, 0xe3, 0xf4, 0xbe, 0xd4,
0x20, 0x26, 0x4a, 0xdb, 0x63, 0x7b, 0xbb, 0x47, 0x0e, 0x1f, 0x56, 0xe0, 0x33,
0x8b, 0x38, 0xe2, 0xa6, 0x90, 0x97,
],
internal_ovk: [
0x4f, 0xf6, 0xfa, 0xf2, 0x06, 0x63, 0x1e, 0xcb, 0x01, 0xf9, 0x57, 0x30, 0xf7,
0xe5, 0x5b, 0xfc, 0xff, 0x8b, 0x02, 0xa3, 0x14, 0x88, 0x5a, 0x6d, 0x24, 0x8e,
0x6e, 0xbe, 0xb7, 0x4d, 0x3e, 0x50,
],
},
TestVector {
c: [
0xa7, 0xaf, 0x9d, 0xb6, 0x99, 0x0e, 0xd8, 0x3d, 0xd6, 0x4a, 0xf3, 0x59, 0x7c,
0x04, 0x32, 0x3e, 0xa5, 0x1b, 0x00, 0x52, 0xad, 0x80, 0x84, 0xa8, 0xb9, 0xda,
0x94, 0x8d, 0x32, 0x0d, 0xad, 0xd6,
],
pk: [
0x02, 0xae, 0x36, 0xb6, 0x1a, 0x3d, 0x10, 0xf1, 0xaa, 0x75, 0x2a, 0xb1, 0xdc,
0x16, 0xe3, 0xe4, 0x9b, 0x6a, 0xc0, 0xd2, 0xae, 0x19, 0x07, 0xd2, 0xe6, 0x94,
0x25, 0xec, 0x12, 0xc9, 0x3a, 0xae, 0xbc,
],
external_ovk: [
0xda, 0x6f, 0x47, 0x0f, 0x42, 0x5b, 0x3d, 0x27, 0xf4, 0x28, 0x6e, 0xf0, 0x3b,
0x7e, 0x87, 0x01, 0x7c, 0x20, 0xa7, 0x10, 0xb3, 0xff, 0xb9, 0xc1, 0xb6, 0x6c,
0x71, 0x60, 0x92, 0xe3, 0xd9, 0xbc,
],
internal_ovk: [
0x09, 0xb5, 0x4f, 0x75, 0xcb, 0x70, 0x32, 0x67, 0x1d, 0xc6, 0x8a, 0xaa, 0x07,
0x30, 0x5f, 0x38, 0xcd, 0xbc, 0x87, 0x9e, 0xe1, 0x5b, 0xec, 0x04, 0x71, 0x3c,
0x24, 0xdc, 0xe3, 0xca, 0x70, 0x26,
],
},
TestVector {
c: [
0xe0, 0x0c, 0x7a, 0x1d, 0x48, 0xaf, 0x04, 0x68, 0x27, 0x59, 0x1e, 0x97, 0x33,
0xa9, 0x7f, 0xa6, 0xb6, 0x79, 0xf3, 0xdc, 0x60, 0x1d, 0x00, 0x82, 0x85, 0xed,
0xcb, 0xda, 0xe6, 0x9c, 0xe8, 0xfc,
],
pk: [
0x02, 0x49, 0x26, 0x53, 0x80, 0xd2, 0xb0, 0x2e, 0x0a, 0x1d, 0x98, 0x8f, 0x3d,
0xe3, 0x45, 0x8b, 0x6e, 0x00, 0x29, 0x1d, 0xb0, 0xe6, 0x2e, 0x17, 0x47, 0x91,
0xd0, 0x09, 0x29, 0x9f, 0x61, 0xfe, 0xc4,
],
external_ovk: [
0x60, 0xa7, 0xa0, 0x8e, 0xef, 0xa2, 0x4e, 0x75, 0xcc, 0xbb, 0x29, 0xdc, 0x84,
0x94, 0x67, 0x2d, 0x73, 0x0f, 0xb3, 0x88, 0x7c, 0xb2, 0x6e, 0xf5, 0x1c, 0x6a,
0x1a, 0x78, 0xe8, 0x8a, 0x78, 0x39,
],
internal_ovk: [
0x3b, 0xab, 0x40, 0x98, 0x08, 0x10, 0x8b, 0xa9, 0xe5, 0xa1, 0xbb, 0x6a, 0x42,
0x24, 0x59, 0x9d, 0x62, 0xcc, 0xee, 0x63, 0xff, 0x2f, 0x38, 0x15, 0x4c, 0x7f,
0xb0, 0xc9, 0xa9, 0xa5, 0x79, 0x0f,
],
},
TestVector {
c: [
0xe2, 0x88, 0x53, 0x15, 0xeb, 0x46, 0x71, 0x09, 0x8b, 0x79, 0x53, 0x5e, 0x79,
0x0f, 0xe5, 0x3e, 0x29, 0xfe, 0xf2, 0xb3, 0x76, 0x66, 0x97, 0xac, 0x32, 0xb4,
0xf4, 0x73, 0xf4, 0x68, 0xa0, 0x08,
],
pk: [
0x03, 0x9a, 0x0e, 0x46, 0x39, 0xb4, 0x69, 0x1f, 0x02, 0x7c, 0x0d, 0xb7, 0xfe,
0xf1, 0xbb, 0x5e, 0xf9, 0x0a, 0xcd, 0xb7, 0x08, 0x62, 0x6d, 0x2e, 0x1f, 0x3e,
0x38, 0x3e, 0xe7, 0x5b, 0x31, 0xcf, 0x57,
],
external_ovk: [
0xbb, 0x47, 0x87, 0x2c, 0x25, 0x09, 0xbf, 0x3c, 0x72, 0xde, 0xdf, 0x4f, 0xc1,
0x77, 0x0f, 0x91, 0x93, 0xe2, 0xc1, 0x90, 0xd7, 0xaa, 0x8e, 0x9e, 0x88, 0x1a,
0xd2, 0xf1, 0x73, 0x48, 0x4e, 0xf2,
],
internal_ovk: [
0x5f, 0x36, 0xdf, 0xa3, 0x6c, 0xa7, 0x65, 0x74, 0x50, 0x29, 0x4e, 0xaa, 0xdd,
0xad, 0x78, 0xaf, 0xf2, 0xb3, 0xdc, 0x38, 0x5a, 0x57, 0x73, 0x5a, 0xc0, 0x0d,
0x3d, 0x9a, 0x29, 0x2b, 0x8c, 0x77,
],
},
TestVector {
c: [
0xed, 0x94, 0x94, 0xc6, 0xac, 0x89, 0x3c, 0x49, 0x72, 0x38, 0x33, 0xec, 0x89,
0x26, 0xc1, 0x03, 0x95, 0x86, 0xa7, 0xaf, 0xcf, 0x4a, 0x0d, 0x9c, 0x73, 0x1e,
0x98, 0x5d, 0x99, 0x58, 0x9c, 0x8b,
],
pk: [
0x03, 0xbb, 0xf4, 0x49, 0x82, 0xf1, 0xba, 0x3a, 0x2b, 0x9d, 0xd3, 0xc1, 0x77,
0x4d, 0x71, 0xce, 0x33, 0x60, 0x59, 0x9b, 0x07, 0xf2, 0x11, 0xc8, 0x16, 0xb8,
0xc4, 0x3b, 0x98, 0x42, 0x23, 0x09, 0x24,
],
external_ovk: [
0xed, 0xe8, 0xfb, 0x11, 0x37, 0x9b, 0x15, 0xae, 0xc4, 0xfa, 0x4e, 0xc5, 0x12,
0x4c, 0x95, 0x00, 0xad, 0xf4, 0x0e, 0xb6, 0xf7, 0xca, 0xa5, 0xe9, 0xce, 0x80,
0xf6, 0xbd, 0x9e, 0x73, 0xd0, 0xe7,
],
internal_ovk: [
0x25, 0x0b, 0x4d, 0xfc, 0x34, 0xdd, 0x57, 0x76, 0x74, 0x51, 0x57, 0xf3, 0x82,
0xce, 0x6d, 0xe4, 0xf6, 0xfe, 0x22, 0xd7, 0x98, 0x02, 0xf3, 0x9f, 0xe1, 0x34,
0x77, 0x8b, 0x79, 0x40, 0x42, 0xd3,
],
},
TestVector {
c: [
0x92, 0x47, 0x69, 0x30, 0xd0, 0x69, 0x89, 0x6c, 0xff, 0x30, 0xeb, 0x41, 0x4f,
0x72, 0x7b, 0x89, 0xe0, 0x01, 0xaf, 0xa2, 0xfb, 0x8d, 0xc3, 0x43, 0x6d, 0x75,
0xa4, 0xa6, 0xf2, 0x65, 0x72, 0x50,
],
pk: [
0x03, 0xff, 0x63, 0xc7, 0x89, 0x25, 0x1c, 0x10, 0x43, 0xc6, 0xf9, 0x6c, 0x66,
0xbf, 0x5b, 0x0f, 0x61, 0xc9, 0xd6, 0x5f, 0xef, 0x5a, 0xaf, 0x42, 0x84, 0xa6,
0xa5, 0x69, 0x94, 0x94, 0x1c, 0x05, 0xfa,
],
external_ovk: [
0xb3, 0x11, 0x52, 0x06, 0x42, 0x71, 0x01, 0x01, 0xbb, 0xc8, 0x1b, 0xbe, 0x92,
0x85, 0x1f, 0x9e, 0x65, 0x36, 0x22, 0x3e, 0xd6, 0xe6, 0xa1, 0x28, 0x59, 0x06,
0x62, 0x1e, 0xfa, 0xe6, 0x41, 0x10,
],
internal_ovk: [
0xf4, 0x46, 0xc0, 0xc1, 0x74, 0x1c, 0x94, 0x42, 0x56, 0x8e, 0x12, 0xf0, 0x55,
0xef, 0xd5, 0x0c, 0x1e, 0xfe, 0x4d, 0x71, 0x53, 0x3d, 0x97, 0x6b, 0x08, 0xe9,
0x94, 0x41, 0x44, 0x49, 0xc4, 0xac,
],
},
TestVector {
c: [
0x7d, 0x41, 0x7a, 0xdb, 0x3d, 0x15, 0xcc, 0x54, 0xdc, 0xb1, 0xfc, 0xe4, 0x67,
0x50, 0x0c, 0x6b, 0x8f, 0xb8, 0x6b, 0x12, 0xb5, 0x6d, 0xa9, 0xc3, 0x82, 0x85,
0x7d, 0xee, 0xcc, 0x40, 0xa9, 0x8d,
],
pk: [
0x02, 0xbf, 0x39, 0x20, 0xce, 0x2e, 0x9e, 0x95, 0xb0, 0xee, 0xce, 0x13, 0x0a,
0x50, 0xba, 0x7d, 0xcc, 0x6f, 0x26, 0x51, 0x2a, 0x9f, 0xc7, 0xb8, 0x04, 0xaf,
0xf0, 0x89, 0xf5, 0x0c, 0xbc, 0xff, 0xf7,
],
external_ovk: [
0xae, 0x63, 0x84, 0xf8, 0x07, 0x72, 0x1c, 0x5f, 0x46, 0xc8, 0xaa, 0x83, 0x3b,
0x66, 0x9b, 0x01, 0xc4, 0x22, 0x7c, 0x00, 0x18, 0xcb, 0x27, 0x29, 0xa9, 0x79,
0x91, 0x01, 0xea, 0xb8, 0x5a, 0xb9,
],
internal_ovk: [
0xef, 0x70, 0x8e, 0xb8, 0x26, 0xd8, 0xbf, 0xcd, 0x7f, 0xaa, 0x4f, 0x90, 0xdf,
0x46, 0x1d, 0xed, 0x08, 0xd1, 0x6e, 0x19, 0x1b, 0x4e, 0x51, 0xb8, 0xa3, 0xa9,
0x1c, 0x02, 0x0b, 0x32, 0xcc, 0x07,
],
},
];
for tv in test_vectors {
for tv in test_vectors::transparent_ovk() {
let mut key_bytes = [0u8; 65];
key_bytes[..32].copy_from_slice(&tv.c);
key_bytes[32..].copy_from_slice(&tv.pk);

View File

@ -15,5 +15,8 @@ pub mod sighash;
#[cfg(feature = "transparent-inputs")]
pub mod keys;
#[cfg(test)]
mod test_vectors;
#[macro_use]
extern crate alloc;

View File

@ -0,0 +1,523 @@
use alloc::vec::Vec;
pub struct TransparentOvkTestVector {
pub c: [u8; 32],
pub pk: [u8; 33],
pub external_ovk: [u8; 32],
pub internal_ovk: [u8; 32],
}
pub fn transparent_ovk() -> Vec<TransparentOvkTestVector> {
use TransparentOvkTestVector as TestVector;
// From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/zip_0316.py
vec![
TestVector {
c: [
0x5d, 0x7a, 0x8f, 0x73, 0x9a, 0x2d, 0x9e, 0x94, 0x5b, 0x0c, 0xe1, 0x52, 0xa8, 0x04,
0x9e, 0x29, 0x4c, 0x4d, 0x6e, 0x66, 0xb1, 0x64, 0x93, 0x9d, 0xaf, 0xfa, 0x2e, 0xf6,
0xee, 0x69, 0x21, 0x48,
],
pk: [
0x02, 0x16, 0x88, 0x4f, 0x1d, 0xbc, 0x92, 0x90, 0x89, 0xa4, 0x17, 0x6e, 0x84, 0x0b,
0xb5, 0x81, 0xc8, 0x0e, 0x16, 0xe9, 0xb1, 0xab, 0xd6, 0x54, 0xe6, 0x2c, 0x8b, 0x0b,
0x95, 0x70, 0x20, 0xb7, 0x48,
],
external_ovk: [
0xdc, 0xe7, 0xfb, 0x7f, 0x20, 0xeb, 0x77, 0x64, 0xd5, 0x12, 0x4f, 0xbd, 0x23, 0xc4,
0xd7, 0xca, 0x8c, 0x32, 0x19, 0xec, 0x1d, 0xb3, 0xff, 0x1e, 0x08, 0x13, 0x50, 0xad,
0x03, 0x9b, 0x40, 0x79,
],
internal_ovk: [
0x4d, 0x46, 0xc7, 0x14, 0xed, 0xda, 0xd9, 0x4a, 0x40, 0xac, 0x21, 0x28, 0x6a, 0xff,
0x32, 0x7d, 0x7e, 0xbf, 0x11, 0x9e, 0x86, 0x85, 0x10, 0x9b, 0x44, 0xe8, 0x02, 0x83,
0xd8, 0xc8, 0xa4, 0x00,
],
},
TestVector {
c: [
0xbf, 0x69, 0xb8, 0x25, 0x0c, 0x18, 0xef, 0x41, 0x29, 0x4c, 0xa9, 0x79, 0x93, 0xdb,
0x54, 0x6c, 0x1f, 0xe0, 0x1f, 0x7e, 0x9c, 0x8e, 0x36, 0xd6, 0xa5, 0xe2, 0x9d, 0x4e,
0x30, 0xa7, 0x35, 0x94,
],
pk: [
0x03, 0x72, 0x73, 0xb6, 0x57, 0xd9, 0x71, 0xa4, 0x5e, 0x72, 0x24, 0x0c, 0x7a, 0xaa,
0xa7, 0xd0, 0x68, 0x5d, 0x06, 0xd7, 0x99, 0x9b, 0x0a, 0x19, 0xc4, 0xce, 0xa3, 0x27,
0x88, 0xa6, 0xab, 0x51, 0x3d,
],
external_ovk: [
0x8d, 0x31, 0x53, 0x7b, 0x38, 0x8f, 0x40, 0x23, 0xe6, 0x48, 0x70, 0x8b, 0xfb, 0xde,
0x2b, 0xa1, 0xff, 0x1a, 0x4e, 0xe1, 0x12, 0xea, 0x67, 0x0a, 0xd1, 0x67, 0x44, 0xf4,
0x58, 0x3e, 0x95, 0x52,
],
internal_ovk: [
0x16, 0x77, 0x49, 0x00, 0x76, 0x9d, 0x9c, 0x03, 0xbe, 0x06, 0x32, 0x45, 0xcf, 0x1c,
0x22, 0x44, 0xa9, 0x2e, 0x48, 0x51, 0x01, 0x54, 0x73, 0x61, 0x3f, 0xbf, 0x38, 0xd2,
0x42, 0xd7, 0x54, 0xf6,
],
},
TestVector {
c: [
0x3d, 0xc1, 0x66, 0xd5, 0x6a, 0x1d, 0x62, 0xf5, 0xa8, 0xd7, 0x55, 0x1d, 0xb5, 0xfd,
0x93, 0x13, 0xe8, 0xc7, 0x20, 0x3d, 0x99, 0x6a, 0xf7, 0xd4, 0x77, 0x08, 0x37, 0x56,
0xd5, 0x9a, 0xf8, 0x0d,
],
pk: [
0x03, 0xec, 0x05, 0xbb, 0x7f, 0x06, 0x5e, 0x25, 0x6f, 0xf4, 0x54, 0xf8, 0xa8, 0xdf,
0x6f, 0x2f, 0x9b, 0x8a, 0x8c, 0x95, 0x08, 0xca, 0xac, 0xfe, 0xe9, 0x52, 0x1c, 0xbe,
0x68, 0x9d, 0xd1, 0x12, 0x0f,
],
external_ovk: [
0xdb, 0x97, 0x52, 0x0e, 0x2f, 0xe3, 0x68, 0xad, 0x50, 0x2d, 0xef, 0xf8, 0x42, 0xf0,
0xc0, 0xee, 0x5d, 0x20, 0x3b, 0x48, 0x33, 0x7a, 0x0f, 0xff, 0x75, 0xbe, 0x24, 0x52,
0x59, 0x77, 0xf3, 0x7e,
],
internal_ovk: [
0xbc, 0x4a, 0xcb, 0x5f, 0x52, 0xb8, 0xae, 0x21, 0xe3, 0x32, 0xb1, 0x7c, 0x29, 0x63,
0x1f, 0x68, 0xe9, 0x68, 0x2a, 0x46, 0xc4, 0xa7, 0xab, 0xc8, 0xed, 0xf9, 0x0d, 0x37,
0xae, 0xea, 0xd3, 0x6c,
],
},
TestVector {
c: [
0x49, 0x5c, 0x22, 0x2f, 0x7f, 0xba, 0x1e, 0x31, 0xde, 0xfa, 0x3d, 0x5a, 0x57, 0xef,
0xc2, 0xe1, 0xe9, 0xb0, 0x1a, 0x03, 0x55, 0x87, 0xd5, 0xfb, 0x1a, 0x38, 0xe0, 0x1d,
0x94, 0x90, 0x3d, 0x3c,
],
pk: [
0x02, 0x81, 0x8f, 0x50, 0xce, 0x47, 0x10, 0xf4, 0xeb, 0x11, 0xe7, 0x43, 0xe6, 0x40,
0x85, 0x44, 0xaa, 0x3c, 0x12, 0x3c, 0x7f, 0x07, 0xe2, 0xaa, 0xbb, 0x91, 0xaf, 0xc4,
0xec, 0x48, 0x78, 0x8d, 0xe9,
],
external_ovk: [
0xb8, 0xa3, 0x6d, 0x62, 0xa6, 0x3f, 0x69, 0x36, 0x7b, 0xe3, 0xf4, 0xbe, 0xd4, 0x20,
0x26, 0x4a, 0xdb, 0x63, 0x7b, 0xbb, 0x47, 0x0e, 0x1f, 0x56, 0xe0, 0x33, 0x8b, 0x38,
0xe2, 0xa6, 0x90, 0x97,
],
internal_ovk: [
0x4f, 0xf6, 0xfa, 0xf2, 0x06, 0x63, 0x1e, 0xcb, 0x01, 0xf9, 0x57, 0x30, 0xf7, 0xe5,
0x5b, 0xfc, 0xff, 0x8b, 0x02, 0xa3, 0x14, 0x88, 0x5a, 0x6d, 0x24, 0x8e, 0x6e, 0xbe,
0xb7, 0x4d, 0x3e, 0x50,
],
},
TestVector {
c: [
0xa7, 0xaf, 0x9d, 0xb6, 0x99, 0x0e, 0xd8, 0x3d, 0xd6, 0x4a, 0xf3, 0x59, 0x7c, 0x04,
0x32, 0x3e, 0xa5, 0x1b, 0x00, 0x52, 0xad, 0x80, 0x84, 0xa8, 0xb9, 0xda, 0x94, 0x8d,
0x32, 0x0d, 0xad, 0xd6,
],
pk: [
0x02, 0xae, 0x36, 0xb6, 0x1a, 0x3d, 0x10, 0xf1, 0xaa, 0x75, 0x2a, 0xb1, 0xdc, 0x16,
0xe3, 0xe4, 0x9b, 0x6a, 0xc0, 0xd2, 0xae, 0x19, 0x07, 0xd2, 0xe6, 0x94, 0x25, 0xec,
0x12, 0xc9, 0x3a, 0xae, 0xbc,
],
external_ovk: [
0xda, 0x6f, 0x47, 0x0f, 0x42, 0x5b, 0x3d, 0x27, 0xf4, 0x28, 0x6e, 0xf0, 0x3b, 0x7e,
0x87, 0x01, 0x7c, 0x20, 0xa7, 0x10, 0xb3, 0xff, 0xb9, 0xc1, 0xb6, 0x6c, 0x71, 0x60,
0x92, 0xe3, 0xd9, 0xbc,
],
internal_ovk: [
0x09, 0xb5, 0x4f, 0x75, 0xcb, 0x70, 0x32, 0x67, 0x1d, 0xc6, 0x8a, 0xaa, 0x07, 0x30,
0x5f, 0x38, 0xcd, 0xbc, 0x87, 0x9e, 0xe1, 0x5b, 0xec, 0x04, 0x71, 0x3c, 0x24, 0xdc,
0xe3, 0xca, 0x70, 0x26,
],
},
TestVector {
c: [
0xe0, 0x0c, 0x7a, 0x1d, 0x48, 0xaf, 0x04, 0x68, 0x27, 0x59, 0x1e, 0x97, 0x33, 0xa9,
0x7f, 0xa6, 0xb6, 0x79, 0xf3, 0xdc, 0x60, 0x1d, 0x00, 0x82, 0x85, 0xed, 0xcb, 0xda,
0xe6, 0x9c, 0xe8, 0xfc,
],
pk: [
0x02, 0x49, 0x26, 0x53, 0x80, 0xd2, 0xb0, 0x2e, 0x0a, 0x1d, 0x98, 0x8f, 0x3d, 0xe3,
0x45, 0x8b, 0x6e, 0x00, 0x29, 0x1d, 0xb0, 0xe6, 0x2e, 0x17, 0x47, 0x91, 0xd0, 0x09,
0x29, 0x9f, 0x61, 0xfe, 0xc4,
],
external_ovk: [
0x60, 0xa7, 0xa0, 0x8e, 0xef, 0xa2, 0x4e, 0x75, 0xcc, 0xbb, 0x29, 0xdc, 0x84, 0x94,
0x67, 0x2d, 0x73, 0x0f, 0xb3, 0x88, 0x7c, 0xb2, 0x6e, 0xf5, 0x1c, 0x6a, 0x1a, 0x78,
0xe8, 0x8a, 0x78, 0x39,
],
internal_ovk: [
0x3b, 0xab, 0x40, 0x98, 0x08, 0x10, 0x8b, 0xa9, 0xe5, 0xa1, 0xbb, 0x6a, 0x42, 0x24,
0x59, 0x9d, 0x62, 0xcc, 0xee, 0x63, 0xff, 0x2f, 0x38, 0x15, 0x4c, 0x7f, 0xb0, 0xc9,
0xa9, 0xa5, 0x79, 0x0f,
],
},
TestVector {
c: [
0xe2, 0x88, 0x53, 0x15, 0xeb, 0x46, 0x71, 0x09, 0x8b, 0x79, 0x53, 0x5e, 0x79, 0x0f,
0xe5, 0x3e, 0x29, 0xfe, 0xf2, 0xb3, 0x76, 0x66, 0x97, 0xac, 0x32, 0xb4, 0xf4, 0x73,
0xf4, 0x68, 0xa0, 0x08,
],
pk: [
0x03, 0x9a, 0x0e, 0x46, 0x39, 0xb4, 0x69, 0x1f, 0x02, 0x7c, 0x0d, 0xb7, 0xfe, 0xf1,
0xbb, 0x5e, 0xf9, 0x0a, 0xcd, 0xb7, 0x08, 0x62, 0x6d, 0x2e, 0x1f, 0x3e, 0x38, 0x3e,
0xe7, 0x5b, 0x31, 0xcf, 0x57,
],
external_ovk: [
0xbb, 0x47, 0x87, 0x2c, 0x25, 0x09, 0xbf, 0x3c, 0x72, 0xde, 0xdf, 0x4f, 0xc1, 0x77,
0x0f, 0x91, 0x93, 0xe2, 0xc1, 0x90, 0xd7, 0xaa, 0x8e, 0x9e, 0x88, 0x1a, 0xd2, 0xf1,
0x73, 0x48, 0x4e, 0xf2,
],
internal_ovk: [
0x5f, 0x36, 0xdf, 0xa3, 0x6c, 0xa7, 0x65, 0x74, 0x50, 0x29, 0x4e, 0xaa, 0xdd, 0xad,
0x78, 0xaf, 0xf2, 0xb3, 0xdc, 0x38, 0x5a, 0x57, 0x73, 0x5a, 0xc0, 0x0d, 0x3d, 0x9a,
0x29, 0x2b, 0x8c, 0x77,
],
},
TestVector {
c: [
0xed, 0x94, 0x94, 0xc6, 0xac, 0x89, 0x3c, 0x49, 0x72, 0x38, 0x33, 0xec, 0x89, 0x26,
0xc1, 0x03, 0x95, 0x86, 0xa7, 0xaf, 0xcf, 0x4a, 0x0d, 0x9c, 0x73, 0x1e, 0x98, 0x5d,
0x99, 0x58, 0x9c, 0x8b,
],
pk: [
0x03, 0xbb, 0xf4, 0x49, 0x82, 0xf1, 0xba, 0x3a, 0x2b, 0x9d, 0xd3, 0xc1, 0x77, 0x4d,
0x71, 0xce, 0x33, 0x60, 0x59, 0x9b, 0x07, 0xf2, 0x11, 0xc8, 0x16, 0xb8, 0xc4, 0x3b,
0x98, 0x42, 0x23, 0x09, 0x24,
],
external_ovk: [
0xed, 0xe8, 0xfb, 0x11, 0x37, 0x9b, 0x15, 0xae, 0xc4, 0xfa, 0x4e, 0xc5, 0x12, 0x4c,
0x95, 0x00, 0xad, 0xf4, 0x0e, 0xb6, 0xf7, 0xca, 0xa5, 0xe9, 0xce, 0x80, 0xf6, 0xbd,
0x9e, 0x73, 0xd0, 0xe7,
],
internal_ovk: [
0x25, 0x0b, 0x4d, 0xfc, 0x34, 0xdd, 0x57, 0x76, 0x74, 0x51, 0x57, 0xf3, 0x82, 0xce,
0x6d, 0xe4, 0xf6, 0xfe, 0x22, 0xd7, 0x98, 0x02, 0xf3, 0x9f, 0xe1, 0x34, 0x77, 0x8b,
0x79, 0x40, 0x42, 0xd3,
],
},
TestVector {
c: [
0x92, 0x47, 0x69, 0x30, 0xd0, 0x69, 0x89, 0x6c, 0xff, 0x30, 0xeb, 0x41, 0x4f, 0x72,
0x7b, 0x89, 0xe0, 0x01, 0xaf, 0xa2, 0xfb, 0x8d, 0xc3, 0x43, 0x6d, 0x75, 0xa4, 0xa6,
0xf2, 0x65, 0x72, 0x50,
],
pk: [
0x03, 0xff, 0x63, 0xc7, 0x89, 0x25, 0x1c, 0x10, 0x43, 0xc6, 0xf9, 0x6c, 0x66, 0xbf,
0x5b, 0x0f, 0x61, 0xc9, 0xd6, 0x5f, 0xef, 0x5a, 0xaf, 0x42, 0x84, 0xa6, 0xa5, 0x69,
0x94, 0x94, 0x1c, 0x05, 0xfa,
],
external_ovk: [
0xb3, 0x11, 0x52, 0x06, 0x42, 0x71, 0x01, 0x01, 0xbb, 0xc8, 0x1b, 0xbe, 0x92, 0x85,
0x1f, 0x9e, 0x65, 0x36, 0x22, 0x3e, 0xd6, 0xe6, 0xa1, 0x28, 0x59, 0x06, 0x62, 0x1e,
0xfa, 0xe6, 0x41, 0x10,
],
internal_ovk: [
0xf4, 0x46, 0xc0, 0xc1, 0x74, 0x1c, 0x94, 0x42, 0x56, 0x8e, 0x12, 0xf0, 0x55, 0xef,
0xd5, 0x0c, 0x1e, 0xfe, 0x4d, 0x71, 0x53, 0x3d, 0x97, 0x6b, 0x08, 0xe9, 0x94, 0x41,
0x44, 0x49, 0xc4, 0xac,
],
},
TestVector {
c: [
0x7d, 0x41, 0x7a, 0xdb, 0x3d, 0x15, 0xcc, 0x54, 0xdc, 0xb1, 0xfc, 0xe4, 0x67, 0x50,
0x0c, 0x6b, 0x8f, 0xb8, 0x6b, 0x12, 0xb5, 0x6d, 0xa9, 0xc3, 0x82, 0x85, 0x7d, 0xee,
0xcc, 0x40, 0xa9, 0x8d,
],
pk: [
0x02, 0xbf, 0x39, 0x20, 0xce, 0x2e, 0x9e, 0x95, 0xb0, 0xee, 0xce, 0x13, 0x0a, 0x50,
0xba, 0x7d, 0xcc, 0x6f, 0x26, 0x51, 0x2a, 0x9f, 0xc7, 0xb8, 0x04, 0xaf, 0xf0, 0x89,
0xf5, 0x0c, 0xbc, 0xff, 0xf7,
],
external_ovk: [
0xae, 0x63, 0x84, 0xf8, 0x07, 0x72, 0x1c, 0x5f, 0x46, 0xc8, 0xaa, 0x83, 0x3b, 0x66,
0x9b, 0x01, 0xc4, 0x22, 0x7c, 0x00, 0x18, 0xcb, 0x27, 0x29, 0xa9, 0x79, 0x91, 0x01,
0xea, 0xb8, 0x5a, 0xb9,
],
internal_ovk: [
0xef, 0x70, 0x8e, 0xb8, 0x26, 0xd8, 0xbf, 0xcd, 0x7f, 0xaa, 0x4f, 0x90, 0xdf, 0x46,
0x1d, 0xed, 0x08, 0xd1, 0x6e, 0x19, 0x1b, 0x4e, 0x51, 0xb8, 0xa3, 0xa9, 0x1c, 0x02,
0x0b, 0x32, 0xcc, 0x07,
],
},
]
}
pub struct Bip32TestVector {
pub c: [u8; 32],
pub pk: [u8; 33],
pub address: [u8; 20],
pub external_ovk: [u8; 32],
pub internal_ovk: [u8; 32],
pub account: u32,
}
pub fn bip_32() -> Vec<Bip32TestVector> {
use Bip32TestVector as TestVector;
// From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/bip_0032.py
vec![
TestVector {
c: [
0x9b, 0xa0, 0x43, 0x9c, 0x6a, 0x2d, 0x3d, 0x90, 0x38, 0x83, 0xd4, 0x53, 0x7c, 0x36,
0x22, 0x88, 0x62, 0x6d, 0xa6, 0x2c, 0x62, 0x99, 0x01, 0x2e, 0x36, 0x2d, 0x8f, 0xb6,
0xef, 0xeb, 0xab, 0x47,
],
pk: [
0x02, 0xed, 0x63, 0x85, 0x32, 0xc4, 0x75, 0xf6, 0x74, 0x00, 0x35, 0x0f, 0xb1, 0xd6,
0xed, 0xa5, 0x59, 0xcd, 0xc2, 0x89, 0xa1, 0x9b, 0x43, 0x19, 0xeb, 0x17, 0x51, 0x40,
0xaa, 0x86, 0x89, 0x38, 0x36,
],
address: [
0x67, 0x25, 0xf2, 0x62, 0xbb, 0xa6, 0x42, 0x2f, 0xd4, 0x7c, 0x30, 0x5b, 0x83, 0x78,
0xc4, 0x99, 0x42, 0x41, 0xc4, 0x42,
],
external_ovk: [
0xd4, 0x86, 0x35, 0x2d, 0xd1, 0xd6, 0x66, 0x98, 0xa6, 0x16, 0x34, 0xab, 0x21, 0x9a,
0x2a, 0x6e, 0xa3, 0xc2, 0xee, 0x98, 0x79, 0xcc, 0x82, 0x84, 0x03, 0xba, 0x99, 0x69,
0x50, 0x57, 0x74, 0xdd,
],
internal_ovk: [
0x73, 0x90, 0xae, 0x2d, 0xf3, 0x1c, 0xee, 0xb2, 0x64, 0xcf, 0xbb, 0xcb, 0xbf, 0xfd,
0x2d, 0x97, 0x3d, 0xb6, 0x8c, 0xf5, 0x72, 0xa7, 0x56, 0xd3, 0x2d, 0x5b, 0xd3, 0xec,
0x00, 0x46, 0x59, 0x7f,
],
account: 0,
},
TestVector {
c: [
0xfa, 0x92, 0x91, 0xb3, 0x53, 0xbe, 0x21, 0xac, 0x45, 0x2f, 0x85, 0xcb, 0x96, 0xe4,
0xfc, 0x97, 0x8d, 0x35, 0x2e, 0x34, 0xc5, 0xc0, 0x25, 0x9a, 0xc2, 0x8d, 0x0b, 0xea,
0xb1, 0xb8, 0xe2, 0x98,
],
pk: [
0x03, 0xfc, 0x39, 0x9e, 0x61, 0x3d, 0x01, 0x08, 0x65, 0xd5, 0xa1, 0xfa, 0x87, 0x65,
0xb7, 0x10, 0x9f, 0x9d, 0xb1, 0xed, 0x56, 0x21, 0x89, 0x83, 0xf9, 0xbd, 0x54, 0xb8,
0xc7, 0x12, 0x47, 0x88, 0x29,
],
address: [
0x04, 0x63, 0x1a, 0xd8, 0x90, 0x2a, 0xd2, 0xfc, 0x56, 0x41, 0xbb, 0xe9, 0x35, 0xde,
0xa6, 0x79, 0x50, 0xbb, 0x9c, 0x59,
],
external_ovk: [
0xd2, 0xbd, 0x69, 0xa3, 0xd3, 0xe8, 0x25, 0xe3, 0x63, 0x3f, 0x49, 0x7f, 0xc1, 0xb5,
0x04, 0xba, 0xf6, 0x73, 0x29, 0xa9, 0x16, 0x74, 0x87, 0xd0, 0xfd, 0x98, 0xca, 0xe5,
0xd1, 0xa9, 0x66, 0x13,
],
internal_ovk: [
0xc8, 0x01, 0x85, 0x9b, 0xd2, 0xfb, 0x9f, 0x09, 0x0d, 0x65, 0x18, 0xe1, 0xfe, 0x19,
0x27, 0x84, 0xe7, 0x5a, 0xb7, 0x69, 0xc8, 0xec, 0x66, 0x21, 0xf7, 0xbc, 0x0c, 0x13,
0x20, 0x82, 0x0b, 0x0a,
],
account: 1,
},
TestVector {
c: [
0xf6, 0xa7, 0x04, 0xfc, 0x09, 0x38, 0x82, 0x16, 0x6a, 0x88, 0xee, 0xb2, 0x43, 0xe2,
0x65, 0x8f, 0x0e, 0xb7, 0xb5, 0xb7, 0x94, 0x3c, 0xe4, 0x7c, 0x39, 0x24, 0xc6, 0x7c,
0x96, 0x47, 0x4c, 0xea,
],
pk: [
0x02, 0x9f, 0x17, 0x94, 0x89, 0x55, 0x62, 0x43, 0x0d, 0x5d, 0xc8, 0xbe, 0x5e, 0x88,
0xcf, 0xee, 0xe3, 0x26, 0x1d, 0x6b, 0xe4, 0xe6, 0xeb, 0x5b, 0x23, 0x8e, 0xcc, 0x9e,
0x7e, 0xbd, 0xeb, 0x1b, 0xf0,
],
address: [
0x0b, 0xec, 0x65, 0xaa, 0x3c, 0xf1, 0xaf, 0x84, 0xa9, 0x5d, 0xa1, 0xe6, 0xb9, 0xe4,
0xa5, 0x2b, 0x74, 0x42, 0x8f, 0xf6,
],
external_ovk: [
0xa6, 0x0c, 0xaa, 0x83, 0x0f, 0x08, 0xd4, 0xa5, 0x4c, 0x39, 0x80, 0x2c, 0x0a, 0xdc,
0x1c, 0x2b, 0xa4, 0x22, 0xce, 0xb8, 0x09, 0x7c, 0xd1, 0x26, 0xa2, 0x08, 0x13, 0xf5,
0x7e, 0x4d, 0x2f, 0x82,
],
internal_ovk: [
0x14, 0xf5, 0x95, 0x92, 0x21, 0x33, 0x8f, 0x3a, 0xdb, 0x60, 0xdf, 0x69, 0x04, 0x2d,
0xea, 0x7c, 0xfb, 0xd8, 0x72, 0x0c, 0x3f, 0xad, 0x1d, 0xeb, 0xaa, 0x0b, 0xea, 0x81,
0x74, 0xce, 0xa5, 0x6e,
],
account: 2,
},
TestVector {
c: [
0x3e, 0xbe, 0x46, 0xd6, 0x20, 0x4f, 0xee, 0xb4, 0x3b, 0xd8, 0x35, 0x11, 0xcd, 0x81,
0x61, 0x34, 0xc2, 0xf0, 0x3d, 0x85, 0x82, 0xc6, 0x64, 0x31, 0x8c, 0xc6, 0x00, 0x63,
0xec, 0xa3, 0x8a, 0x04,
],
pk: [
0x02, 0x0f, 0x8a, 0xed, 0x76, 0x90, 0xbc, 0x84, 0xe3, 0xfa, 0x65, 0x10, 0xc3, 0x62,
0xbb, 0x92, 0x90, 0x90, 0x4b, 0x6f, 0xf5, 0xb7, 0x5e, 0x4e, 0x5c, 0xa6, 0xde, 0x82,
0x1b, 0xf3, 0x38, 0x9f, 0xae,
],
address: [
0x75, 0x2c, 0x53, 0xa4, 0x3b, 0x8a, 0x44, 0x18, 0x25, 0x50, 0xed, 0x66, 0x8d, 0x49,
0x94, 0x1c, 0x4f, 0xef, 0x55, 0x02,
],
external_ovk: [
0x00, 0x96, 0xdd, 0xb9, 0xce, 0xa0, 0x3e, 0x17, 0xf2, 0x43, 0x0c, 0xe3, 0xf6, 0x1d,
0xf8, 0xcd, 0x43, 0x30, 0x94, 0x50, 0xf0, 0x1e, 0xfd, 0x6f, 0x5b, 0x33, 0xae, 0xc7,
0xac, 0xe1, 0x65, 0xbd,
],
internal_ovk: [
0x23, 0xb2, 0xef, 0x2b, 0x1e, 0xe4, 0x8a, 0xf6, 0x45, 0x9c, 0xe7, 0xf0, 0x61, 0x25,
0x14, 0x3d, 0xc9, 0x5c, 0xbe, 0x1e, 0xbf, 0x49, 0xd4, 0x11, 0xdb, 0x91, 0xe8, 0x8b,
0x59, 0x34, 0x14, 0x06,
],
account: 3,
},
TestVector {
c: [
0x93, 0x4d, 0x5c, 0x7b, 0x67, 0xec, 0xeb, 0xc7, 0xfe, 0x71, 0x7f, 0xfb, 0xa0, 0x6f,
0x30, 0x97, 0x3e, 0xcd, 0xb4, 0x73, 0x5d, 0xd8, 0xc8, 0x17, 0x35, 0x28, 0xc3, 0x57,
0xec, 0x23, 0x31, 0x1f,
],
pk: [
0x03, 0x9e, 0xfd, 0xdc, 0x9c, 0xc1, 0xbf, 0x9f, 0x42, 0x14, 0xa0, 0x9a, 0x7f, 0x01,
0x88, 0x54, 0x07, 0x89, 0xb2, 0x61, 0x97, 0xcd, 0xed, 0xed, 0xc9, 0x93, 0xbe, 0x53,
0x81, 0x58, 0x7f, 0x79, 0xde,
],
address: [
0x1a, 0x8f, 0xaa, 0x82, 0xb6, 0xfe, 0x12, 0x85, 0x53, 0xc2, 0xf3, 0xf3, 0x8b, 0x22,
0x51, 0xd8, 0x88, 0x80, 0x48, 0xab,
],
external_ovk: [
0xed, 0x3e, 0xc5, 0xb6, 0x23, 0x27, 0x62, 0xb0, 0xda, 0x1b, 0x1c, 0xc4, 0xc6, 0x2e,
0x1e, 0x4f, 0x30, 0x29, 0x27, 0x40, 0x48, 0xe3, 0xf1, 0x80, 0x81, 0x46, 0x40, 0x1f,
0xc4, 0xd1, 0xf6, 0x1c,
],
internal_ovk: [
0x19, 0xd7, 0xd9, 0x37, 0xae, 0x9a, 0x49, 0xb1, 0xa5, 0x23, 0x7a, 0x06, 0xc5, 0xef,
0x3c, 0x7d, 0xa8, 0xde, 0x44, 0xe6, 0xcd, 0x64, 0x3b, 0xe3, 0xfd, 0xe7, 0x09, 0x14,
0x68, 0xcc, 0x24, 0x9c,
],
account: 4,
},
TestVector {
c: [
0x03, 0xeb, 0x45, 0x2d, 0xae, 0x94, 0xc4, 0xee, 0xa9, 0x07, 0x7f, 0x24, 0x5d, 0x72,
0xb1, 0xa1, 0xe0, 0x8f, 0xa7, 0xd4, 0x96, 0x70, 0x2e, 0x6d, 0x45, 0xb9, 0xf5, 0xb3,
0xd4, 0x93, 0xb6, 0x94,
],
pk: [
0x03, 0xe0, 0x32, 0x02, 0x9b, 0xfe, 0x0a, 0xbd, 0xf0, 0x0e, 0x26, 0xee, 0xe7, 0x7e,
0x4c, 0x3b, 0x55, 0x67, 0x44, 0x86, 0xc9, 0x03, 0x42, 0x86, 0x48, 0xb2, 0x6a, 0xdb,
0x5c, 0x11, 0xce, 0xd5, 0xb3,
],
address: [
0xe5, 0x9b, 0x1c, 0x45, 0xcf, 0xda, 0x3f, 0x6f, 0x2d, 0xf7, 0x8d, 0x04, 0xbd, 0x0d,
0xf8, 0xa5, 0x93, 0x17, 0x88, 0x36,
],
external_ovk: [
0xc7, 0x3c, 0xd3, 0x90, 0xf8, 0xf4, 0x7d, 0xba, 0x4c, 0x87, 0x4c, 0x12, 0xc2, 0x23,
0xea, 0x47, 0x8e, 0x2b, 0x40, 0xc4, 0xfc, 0x8f, 0x5e, 0xcf, 0xc5, 0xa1, 0xda, 0x10,
0x38, 0xec, 0x45, 0x29,
],
internal_ovk: [
0x4b, 0x15, 0x90, 0x4c, 0x8c, 0x31, 0xea, 0x27, 0x22, 0x80, 0xeb, 0x75, 0xfb, 0xfa,
0x5e, 0xbd, 0xfa, 0x31, 0x60, 0x70, 0x83, 0xac, 0x56, 0x0d, 0x8f, 0x6e, 0x6e, 0xe3,
0x69, 0x0c, 0x00, 0xa4,
],
account: 5,
},
TestVector {
c: [
0xde, 0xcf, 0x85, 0x43, 0x0d, 0xb4, 0x84, 0x89, 0xcd, 0xd8, 0x94, 0xaa, 0x29, 0xa7,
0x8b, 0x33, 0x15, 0xd2, 0x3b, 0xb6, 0x25, 0x88, 0x27, 0x57, 0xe3, 0x39, 0x6d, 0xf6,
0xe3, 0xba, 0xd6, 0xca,
],
pk: [
0x02, 0x8e, 0xfe, 0x8f, 0xa9, 0xb8, 0x82, 0x7f, 0x87, 0x48, 0x4a, 0xa1, 0x86, 0x87,
0x33, 0x72, 0xa4, 0x6e, 0x53, 0x8a, 0x1c, 0x3f, 0x34, 0x1a, 0xdb, 0x9c, 0x33, 0x69,
0xac, 0x4d, 0x4f, 0x70, 0x7a,
],
address: [
0x3a, 0x9c, 0x2a, 0xd9, 0x50, 0x09, 0x8f, 0x11, 0x1c, 0x3e, 0xdd, 0x0d, 0x3e, 0xb3,
0x09, 0x1c, 0x96, 0xea, 0x83, 0x56,
],
external_ovk: [
0x5c, 0x49, 0xa5, 0x6a, 0xdf, 0xff, 0x55, 0xb7, 0xfb, 0xa2, 0x8f, 0x52, 0xf2, 0x0e,
0x30, 0x64, 0xde, 0xdb, 0x2a, 0x65, 0xb3, 0x0f, 0x19, 0xf6, 0x8a, 0xed, 0x58, 0x89,
0xcd, 0xd7, 0xe4, 0x30,
],
internal_ovk: [
0x4d, 0x55, 0xd6, 0xdd, 0x28, 0x70, 0xc2, 0xf6, 0x29, 0x48, 0x68, 0x5d, 0x0e, 0x70,
0x27, 0x1a, 0x45, 0xe4, 0x90, 0xf6, 0xb8, 0xc3, 0x65, 0x02, 0x83, 0x5a, 0xbc, 0x92,
0xca, 0x92, 0x5f, 0xf3,
],
account: 6,
},
TestVector {
c: [
0x69, 0x4c, 0xc0, 0x9d, 0xd2, 0x42, 0xe4, 0xa7, 0xb7, 0x4e, 0x3b, 0x3c, 0xd7, 0x95,
0xfe, 0x69, 0x59, 0xfa, 0x57, 0x7b, 0xa5, 0x6f, 0xde, 0xb5, 0xfc, 0xf4, 0xc1, 0xa4,
0x50, 0x2d, 0xec, 0x75,
],
pk: [
0x02, 0x14, 0x15, 0x8d, 0xc4, 0x63, 0x1f, 0x2a, 0x37, 0x84, 0xbf, 0xb4, 0x2b, 0x9a,
0xd4, 0x4d, 0xcb, 0x77, 0x9d, 0xcf, 0x0f, 0x26, 0xa1, 0xde, 0xf9, 0x12, 0x0f, 0x81,
0xc9, 0x83, 0x6b, 0xf4, 0xb5,
],
address: [
0x0f, 0xf6, 0xc3, 0xeb, 0xc6, 0x25, 0x38, 0xff, 0x1d, 0x69, 0x0d, 0xc8, 0xe0, 0x7a,
0x91, 0x3b, 0x15, 0xfe, 0xe1, 0xc5,
],
external_ovk: [
0xa2, 0x61, 0x04, 0x00, 0x35, 0x27, 0xbb, 0xf9, 0x39, 0xb6, 0x00, 0x26, 0xd7, 0x28,
0xd5, 0x6c, 0xda, 0xa5, 0xcd, 0xed, 0x07, 0x20, 0x9a, 0x2c, 0x62, 0xf8, 0x6d, 0xe7,
0x29, 0x86, 0x18, 0xad,
],
internal_ovk: [
0x91, 0x7f, 0x76, 0x7b, 0x53, 0x4b, 0xd8, 0x21, 0xb2, 0x46, 0x39, 0x86, 0x00, 0x49,
0xef, 0x4c, 0x8e, 0xf8, 0xa2, 0xec, 0xfb, 0x62, 0x91, 0xdc, 0x15, 0xa8, 0xbd, 0xa2,
0xf6, 0x5b, 0x8c, 0x23,
],
account: 7,
},
TestVector {
c: [
0x3e, 0xea, 0x14, 0x08, 0xbf, 0xfa, 0x9c, 0x4c, 0x02, 0xdf, 0x5d, 0xd1, 0x74, 0xe8,
0xb5, 0x6e, 0x45, 0x06, 0xca, 0xad, 0xe7, 0x83, 0x92, 0x67, 0x76, 0x12, 0x27, 0xe4,
0xda, 0x25, 0x06, 0xa5,
],
pk: [
0x03, 0x5d, 0x0d, 0x72, 0x24, 0xc3, 0xbe, 0xb7, 0x8b, 0xc6, 0x7c, 0x21, 0x4f, 0x56,
0x73, 0x1b, 0x3f, 0xfb, 0x27, 0xb0, 0x63, 0x10, 0xa1, 0xe6, 0x09, 0x33, 0x84, 0xf6,
0xeb, 0x72, 0xb6, 0xc5, 0xf6,
],
address: [
0x9f, 0xf4, 0x3f, 0x3f, 0x01, 0x21, 0xbf, 0x05, 0x4c, 0x14, 0xea, 0x0d, 0x9d, 0x84,
0x9e, 0x0b, 0x02, 0xe9, 0x46, 0x87,
],
external_ovk: [
0x7a, 0xa8, 0xb1, 0xf6, 0x6d, 0xa9, 0xfe, 0xbf, 0x1a, 0x8c, 0xa9, 0x2f, 0xaa, 0x4b,
0x3f, 0x83, 0x8a, 0xb4, 0x50, 0x3e, 0xa4, 0x18, 0x3d, 0xcf, 0x05, 0xf6, 0x7c, 0x1b,
0x13, 0x58, 0x79, 0x10,
],
internal_ovk: [
0x77, 0xd1, 0x93, 0x54, 0xbd, 0xc0, 0xea, 0xf3, 0xb4, 0x00, 0x65, 0xb9, 0xc7, 0xfa,
0xc8, 0xc2, 0xf7, 0x04, 0x08, 0x17, 0x74, 0xab, 0xde, 0x2d, 0x15, 0x13, 0x1f, 0x80,
0x96, 0x4d, 0x76, 0xfd,
],
account: 8,
},
TestVector {
c: [
0xb6, 0x08, 0x95, 0x76, 0x6b, 0xda, 0xd0, 0x50, 0xed, 0x93, 0x2d, 0x00, 0x99, 0x83,
0x22, 0x55, 0xdc, 0x09, 0x66, 0xea, 0xb8, 0xf9, 0x8a, 0x3b, 0x15, 0x77, 0xf4, 0x50,
0xf2, 0x26, 0xa9, 0x41,
],
pk: [
0x02, 0x95, 0x59, 0x9f, 0xc0, 0x48, 0xf2, 0x18, 0x11, 0x56, 0xf9, 0xe4, 0x53, 0x73,
0x5d, 0x98, 0x9e, 0xb6, 0x16, 0x23, 0xf6, 0xee, 0xe8, 0xa0, 0x60, 0xb8, 0xf3, 0xfa,
0x59, 0x66, 0x6c, 0xdf, 0xe1,
],
address: [
0xda, 0xeb, 0xdd, 0x95, 0x7b, 0xe5, 0x47, 0x02, 0xdb, 0x56, 0xdd, 0x0d, 0x1c, 0x19,
0xa7, 0x76, 0x06, 0xdf, 0xec, 0xd5,
],
external_ovk: [
0xa5, 0x30, 0x77, 0x62, 0x06, 0x17, 0xc1, 0xd1, 0xce, 0xad, 0xa1, 0x21, 0x2e, 0xe5,
0x48, 0x3e, 0x1c, 0xd3, 0x10, 0x34, 0x82, 0x1c, 0x59, 0x8c, 0x04, 0x90, 0xe8, 0x97,
0xa9, 0x60, 0xe8, 0xcb,
],
internal_ovk: [
0x48, 0x16, 0x20, 0x80, 0xf8, 0x57, 0x4d, 0x87, 0xab, 0x71, 0x41, 0x45, 0x06, 0x46,
0xe2, 0x83, 0x79, 0x17, 0xdf, 0xd8, 0x38, 0xda, 0xac, 0x0b, 0x59, 0x32, 0xd1, 0x56,
0xdc, 0xec, 0xbb, 0x2f,
],
account: 9,
},
]
}