diff --git a/zcash_client_backend/src/data_api/wallet.rs b/zcash_client_backend/src/data_api/wallet.rs index 76e38d38d..093f52452 100644 --- a/zcash_client_backend/src/data_api/wallet.rs +++ b/zcash_client_backend/src/data_api/wallet.rs @@ -9,6 +9,7 @@ use zcash_primitives::{ self, note_encryption::{try_sapling_note_decryption, PreparedIncomingViewingKey}, prover::{OutputProver, SpendProver}, + zip32::{DiversifiableFullViewingKey, ExtendedSpendingKey}, Node, }, transaction::{ @@ -17,7 +18,7 @@ use zcash_primitives::{ fees::{zip317::FeeError as Zip317FeeError, FeeRule, StandardFeeRule}, Transaction, TxId, }, - zip32::{sapling::DiversifiableFullViewingKey, sapling::ExtendedSpendingKey, AccountId, Scope}, + zip32::{AccountId, Scope}, }; use crate::{ diff --git a/zcash_client_backend/src/keys.rs b/zcash_client_backend/src/keys.rs index a850b618d..028d447fc 100644 --- a/zcash_client_backend/src/keys.rs +++ b/zcash_client_backend/src/keys.rs @@ -28,7 +28,7 @@ use { }; pub mod sapling { - pub use zcash_primitives::zip32::sapling::{ + pub use zcash_primitives::sapling::zip32::{ DiversifiableFullViewingKey, ExtendedFullViewingKey, ExtendedSpendingKey, }; use zcash_primitives::zip32::{AccountId, ChildIndex}; @@ -62,9 +62,9 @@ pub mod sapling { ExtendedSpendingKey::from_path( &ExtendedSpendingKey::master(seed), &[ - ChildIndex::Hardened(32), - ChildIndex::Hardened(coin_type), - ChildIndex::Hardened(account.into()), + ChildIndex::hardened(32), + ChildIndex::hardened(coin_type), + account.into(), ], ) } diff --git a/zcash_client_backend/src/scanning.rs b/zcash_client_backend/src/scanning.rs index 28cfbdd5e..c773100cc 100644 --- a/zcash_client_backend/src/scanning.rs +++ b/zcash_client_backend/src/scanning.rs @@ -13,9 +13,10 @@ use zcash_primitives::{ sapling::{ self, note_encryption::{CompactOutputDescription, PreparedIncomingViewingKey, SaplingDomain}, + zip32::DiversifiableFullViewingKey, SaplingIvk, }, - zip32::{sapling::DiversifiableFullViewingKey, AccountId, Scope}, + zip32::{AccountId, Scope}, }; use crate::data_api::{BlockMetadata, ScannedBlock, ShieldedProtocol}; diff --git a/zcash_client_sqlite/src/testing.rs b/zcash_client_sqlite/src/testing.rs index 57433b17d..ab2d5eacd 100644 --- a/zcash_client_sqlite/src/testing.rs +++ b/zcash_client_sqlite/src/testing.rs @@ -49,6 +49,7 @@ use zcash_primitives::{ note_encryption::{sapling_note_encryption, SaplingDomain}, util::generate_random_rseed, value::NoteValue, + zip32::DiversifiableFullViewingKey, Note, Nullifier, PaymentAddress, }, transaction::{ @@ -56,7 +57,7 @@ use zcash_primitives::{ fees::{zip317::FeeError as Zip317FeeError, FeeRule, StandardFeeRule}, Transaction, TxId, }, - zip32::{sapling::DiversifiableFullViewingKey, DiversifierIndex}, + zip32::DiversifierIndex, }; use crate::{ diff --git a/zcash_client_sqlite/src/wallet/init.rs b/zcash_client_sqlite/src/wallet/init.rs index 49e2b79ee..1de985dbf 100644 --- a/zcash_client_sqlite/src/wallet/init.rs +++ b/zcash_client_sqlite/src/wallet/init.rs @@ -176,8 +176,9 @@ mod tests { use zcash_primitives::{ consensus::{self, BlockHeight, BranchId, Network, NetworkUpgrade, Parameters}, + sapling::zip32::ExtendedFullViewingKey, transaction::{TransactionData, TxVersion}, - zip32::{sapling::ExtendedFullViewingKey, AccountId}, + zip32::AccountId, }; use crate::{testing::TestBuilder, wallet::scanning::priority_code, WalletDb}; diff --git a/zcash_client_sqlite/src/wallet/sapling.rs b/zcash_client_sqlite/src/wallet/sapling.rs index 31772b927..db537f2b8 100644 --- a/zcash_client_sqlite/src/wallet/sapling.rs +++ b/zcash_client_sqlite/src/wallet/sapling.rs @@ -429,6 +429,7 @@ pub(crate) mod tests { sapling::{ note_encryption::try_sapling_output_recovery, prover::{OutputProver, SpendProver}, + zip32::ExtendedSpendingKey, Node, Note, PaymentAddress, }, transaction::{ @@ -438,7 +439,7 @@ pub(crate) mod tests { }, Transaction, }, - zip32::{sapling::ExtendedSpendingKey, Scope}, + zip32::Scope, }; use zcash_client_backend::{ diff --git a/zcash_primitives/CHANGELOG.md b/zcash_primitives/CHANGELOG.md index 8ece05a42..a5d4c14de 100644 --- a/zcash_primitives/CHANGELOG.md +++ b/zcash_primitives/CHANGELOG.md @@ -54,6 +54,7 @@ and this library adheres to Rust's notion of - `ValueCommitTrapdoor::from_bytes` - `impl Sub for TrapdoorSum` - `impl Sub for CommitmentSum` + - `zip32` module (moved from `zcash_primitives::zip32::sapling`). - `impl Debug for keys::{ExpandedSpendingKey, ProofGenerationKey}` - `zcash_primitives::transaction`: - `builder::get_fee` @@ -71,6 +72,12 @@ and this library adheres to Rust's notion of - `GRACE_ACTIONS` - `P2PKH_STANDARD_INPUT_SIZE` - `P2PKH_STANDARD_OUTPUT_SIZE` +- `zcash_primitives::zip32`: + - `ChildIndex::hardened` + - `ChildIndex::index` + - `ChainCode::new` + - `ChainCode::as_bytes` + - `impl From for ChildIndex` - Test helpers, behind the `test-dependencies` feature flag: - `zcash_primitives::sapling::prover::mock::{MockSpendProver, MockOutputProver}` - Additions related to `zcash_primitive::components::amount::Amount` @@ -120,6 +127,7 @@ and this library adheres to Rust's notion of - `bundle::MapAuth` trait methods now take `&mut self` instead of `&self`. - `circuit::ValueCommitmentOpening::value` is now represented as a `NoteValue` instead of as a bare `u64`. + - `keys::DecodingError` has a new variant `UnsupportedChildIndex`. - `note_encryption`: - `SaplingDomain` no longer has a `P: consensus::Parameters` type parameter. - The following methods now take a `Zip212Enforcement` argument instead of a @@ -154,6 +162,9 @@ and this library adheres to Rust's notion of - `fees::fixed::FeeRule::fixed_fee` - `fees::zip317::FeeRule::marginal_fee` - `sighash::TransparentAuthorizingContext::input_amounts` +- `zcash_primitives::zip32`: + - `ChildIndex` has been changed from an enum to an opaque struct, and no + longer supports non-hardened indices. ### Removed - `zcash_primitives::constants`: @@ -187,6 +198,11 @@ and this library adheres to Rust's notion of - `Bundle::::apply_signatures` (use `Bundle::>::apply_signatures` instead). - `impl From for u64` +- `zcash_primitives::zip32`: + - `sapling` module (moved from `zcash_primitives::sapling::zip32`). + - `ChildIndex::Hardened` (use `ChildIndex::hardened` instead). + - `ChildIndex::NonHardened` + - `sapling::ExtendedFullViewingKey::derive_child` ## [0.13.0] - 2023-09-25 ### Added diff --git a/zcash_primitives/src/sapling.rs b/zcash_primitives/src/sapling.rs index d0ee8d53f..74e8ff5be 100644 --- a/zcash_primitives/src/sapling.rs +++ b/zcash_primitives/src/sapling.rs @@ -17,6 +17,7 @@ mod tree; pub mod util; pub mod value; mod verifier; +pub mod zip32; use group::GroupEncoding; use rand_core::{CryptoRng, RngCore}; diff --git a/zcash_primitives/src/sapling/builder.rs b/zcash_primitives/src/sapling/builder.rs index 97434e7fa..2d255c60a 100644 --- a/zcash_primitives/src/sapling/builder.rs +++ b/zcash_primitives/src/sapling/builder.rs @@ -865,17 +865,15 @@ pub mod testing { use proptest::prelude::*; use rand::{rngs::StdRng, SeedableRng}; - use crate::{ - sapling::{ - bundle::{Authorized, Bundle}, - note_encryption::Zip212Enforcement, - prover::mock::{MockOutputProver, MockSpendProver}, - redjubjub::PrivateKey, - testing::{arb_node, arb_note}, - value::testing::arb_positive_note_value, - Diversifier, - }, - zip32::sapling::testing::arb_extended_spending_key, + use crate::sapling::{ + bundle::{Authorized, Bundle}, + note_encryption::Zip212Enforcement, + prover::mock::{MockOutputProver, MockSpendProver}, + redjubjub::PrivateKey, + testing::{arb_node, arb_note}, + value::testing::arb_positive_note_value, + zip32::testing::arb_extended_spending_key, + Diversifier, }; use incrementalmerkletree::{ frontier::testing::arb_commitment_tree, witness::IncrementalWitness, diff --git a/zcash_primitives/src/sapling/keys.rs b/zcash_primitives/src/sapling/keys.rs index aa26edd6a..e434253fa 100644 --- a/zcash_primitives/src/sapling/keys.rs +++ b/zcash_primitives/src/sapling/keys.rs @@ -33,6 +33,9 @@ pub enum DecodingError { InvalidAsk, /// Could not decode the `nsk` bytes to a jubjub field element. InvalidNsk, + /// An extended spending key had an unsupported child index: either a non-hardened + /// index, or a non-zero index at depth 0. + UnsupportedChildIndex, } /// An outgoing viewing key @@ -101,7 +104,9 @@ impl ExpandedSpendingKey { DecodingError::InvalidNsk => { io::Error::new(io::ErrorKind::InvalidData, "nsk not in field") } - DecodingError::LengthInvalid { .. } => unreachable!(), + DecodingError::LengthInvalid { .. } | DecodingError::UnsupportedChildIndex => { + unreachable!() + } }) } diff --git a/zcash_primitives/src/zip32/sapling.rs b/zcash_primitives/src/sapling/zip32.rs similarity index 58% rename from zcash_primitives/src/zip32/sapling.rs rename to zcash_primitives/src/sapling/zip32.rs index cd5909ae3..4971ef0df 100644 --- a/zcash_primitives/src/zip32/sapling.rs +++ b/zcash_primitives/src/sapling/zip32.rs @@ -11,17 +11,15 @@ use fpe::ff1::{BinaryNumeralString, FF1}; use std::io::{self, Read, Write}; use std::ops::AddAssign; -use super::{ - ChainCode, ChildIndex, Diversifier, DiversifierIndex, NullifierDerivingKey, PaymentAddress, - Scope, ViewingKey, -}; +use super::{Diversifier, NullifierDerivingKey, PaymentAddress, ViewingKey}; use crate::{ keys::{prf_expand, prf_expand_vec}, sapling::{ - constants::{PROOF_GENERATION_KEY_GENERATOR, SPENDING_KEY_GENERATOR}, + constants::PROOF_GENERATION_KEY_GENERATOR, keys::{DecodingError, ExpandedSpendingKey, FullViewingKey, OutgoingViewingKey}, SaplingIvk, }, + zip32::{ChainCode, ChildIndex, DiversifierIndex, Scope}, }; pub const ZIP32_SAPLING_MASTER_PERSONALIZATION: &[u8; 16] = b"ZcashIP32Sapling"; @@ -231,12 +229,40 @@ impl DiversifierKey { } } +/// The derivation index associated with a key. +/// +/// Master keys are never derived via the ZIP 32 child derivation process, but they have +/// an index in their encoding. This type allows the encoding to be represented, while +/// also enabling the derivation methods to only accept [`ChildIndex`]. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +enum KeyIndex { + Master, + Child(ChildIndex), +} + +impl KeyIndex { + fn new(depth: u8, i: u32) -> Option { + match (depth == 0, i) { + (true, 0) => Some(KeyIndex::Master), + (false, _) => ChildIndex::from_index(i).map(KeyIndex::Child), + _ => None, + } + } + + fn index(&self) -> u32 { + match self { + KeyIndex::Master => 0, + KeyIndex::Child(i) => i.index(), + } + } +} + /// A Sapling extended spending key #[derive(Clone)] pub struct ExtendedSpendingKey { depth: u8, parent_fvk_tag: FvkTag, - child_index: ChildIndex, + child_index: KeyIndex, chain_code: ChainCode, pub expsk: ExpandedSpendingKey, dk: DiversifierKey, @@ -279,8 +305,8 @@ impl ExtendedSpendingKey { ExtendedSpendingKey { depth: 0, parent_fvk_tag: FvkTag::master(), - child_index: ChildIndex::master(), - chain_code: ChainCode(c_m), + child_index: KeyIndex::Master, + chain_code: ChainCode::new(c_m), expsk: ExpandedSpendingKey::from_spending_key(sk_m), dk: DiversifierKey::master(sk_m), } @@ -303,10 +329,11 @@ impl ExtendedSpendingKey { let mut ci_bytes = [0u8; 4]; ci_bytes[..].copy_from_slice(&b[5..9]); - let child_index = ChildIndex::from_index(u32::from_le_bytes(ci_bytes)); + let child_index = KeyIndex::new(depth, u32::from_le_bytes(ci_bytes)) + .ok_or(DecodingError::UnsupportedChildIndex)?; - let mut chain_code = ChainCode([0u8; 32]); - chain_code.0[..].copy_from_slice(&b[9..41]); + let mut c = [0u8; 32]; + c[..].copy_from_slice(&b[9..41]); let expsk = ExpandedSpendingKey::from_bytes(&b[41..137])?; @@ -317,19 +344,26 @@ impl ExtendedSpendingKey { depth, parent_fvk_tag, child_index, - chain_code, + chain_code: ChainCode::new(c), expsk, dk, }) } - /// Reads and decodes the encoded form of the extended spending key as define in + /// Reads and decodes the encoded form of the extended spending key as defined in /// [ZIP 32](https://zips.z.cash/zip-0032) from the provided reader. pub fn read(mut reader: R) -> io::Result { let depth = reader.read_u8()?; let mut tag = [0; 4]; reader.read_exact(&mut tag)?; - let i = reader.read_u32::()?; + let child_index = reader.read_u32::().and_then(|i| { + KeyIndex::new(depth, i).ok_or_else(|| { + io::Error::new( + io::ErrorKind::Unsupported, + "Unsupported child index in encoding", + ) + }) + })?; let mut c = [0; 32]; reader.read_exact(&mut c)?; let expsk = ExpandedSpendingKey::read(&mut reader)?; @@ -339,8 +373,8 @@ impl ExtendedSpendingKey { Ok(ExtendedSpendingKey { depth, parent_fvk_tag: FvkTag(tag), - child_index: ChildIndex::from_index(i), - chain_code: ChainCode(c), + child_index, + chain_code: ChainCode::new(c), expsk, dk: DiversifierKey(dk), }) @@ -352,7 +386,7 @@ impl ExtendedSpendingKey { let mut result = [0u8; 169]; result[0] = self.depth; result[1..5].copy_from_slice(&self.parent_fvk_tag.as_bytes()[..]); - result[5..9].copy_from_slice(&self.child_index.value().to_le_bytes()[..]); + result[5..9].copy_from_slice(&self.child_index.index().to_le_bytes()[..]); result[9..41].copy_from_slice(&self.chain_code.as_bytes()[..]); result[41..137].copy_from_slice(&self.expsk.to_bytes()[..]); result[137..169].copy_from_slice(&self.dk.as_bytes()[..]); @@ -377,23 +411,13 @@ impl ExtendedSpendingKey { #[must_use] pub fn derive_child(&self, i: ChildIndex) -> Self { let fvk = FullViewingKey::from_expanded_spending_key(&self.expsk); - let tmp = match i { - ChildIndex::Hardened(i) => { - let mut le_i = [0; 4]; - LittleEndian::write_u32(&mut le_i, i + (1 << 31)); - prf_expand_vec( - &self.chain_code.0, - &[&[0x11], &self.expsk.to_bytes(), &self.dk.0, &le_i], - ) - } - ChildIndex::NonHardened(i) => { - let mut le_i = [0; 4]; - LittleEndian::write_u32(&mut le_i, i); - prf_expand_vec( - &self.chain_code.0, - &[&[0x12], &fvk.to_bytes(), &self.dk.0, &le_i], - ) - } + let tmp = { + let mut le_i = [0; 4]; + LittleEndian::write_u32(&mut le_i, i.index()); + prf_expand_vec( + self.chain_code.as_bytes(), + &[&[0x11], &self.expsk.to_bytes(), &self.dk.0, &le_i], + ) }; let i_l = &tmp.as_bytes()[..32]; let mut c_i = [0u8; 32]; @@ -402,8 +426,8 @@ impl ExtendedSpendingKey { ExtendedSpendingKey { depth: self.depth + 1, parent_fvk_tag: FvkFingerprint::from(&fvk).tag(), - child_index: i, - chain_code: ChainCode(c_i), + child_index: KeyIndex::Child(i), + chain_code: ChainCode::new(c_i), expsk: { let mut ask = jubjub::Fr::from_bytes_wide(prf_expand(i_l, &[0x13]).as_array()); let mut nsk = jubjub::Fr::from_bytes_wide(prf_expand(i_l, &[0x14]).as_array()); @@ -483,7 +507,7 @@ impl ExtendedSpendingKey { pub struct ExtendedFullViewingKey { depth: u8, parent_fvk_tag: FvkTag, - child_index: ChildIndex, + child_index: KeyIndex, chain_code: ChainCode, pub fvk: FullViewingKey, pub(crate) dk: DiversifierKey, @@ -517,7 +541,14 @@ impl ExtendedFullViewingKey { let depth = reader.read_u8()?; let mut tag = [0; 4]; reader.read_exact(&mut tag)?; - let i = reader.read_u32::()?; + let child_index = reader.read_u32::().and_then(|i| { + KeyIndex::new(depth, i).ok_or_else(|| { + io::Error::new( + io::ErrorKind::Unsupported, + "Unsupported child index in encoding", + ) + }) + })?; let mut c = [0; 32]; reader.read_exact(&mut c)?; let fvk = FullViewingKey::read(&mut reader)?; @@ -527,8 +558,8 @@ impl ExtendedFullViewingKey { Ok(ExtendedFullViewingKey { depth, parent_fvk_tag: FvkTag(tag), - child_index: ChildIndex::from_index(i), - chain_code: ChainCode(c), + child_index, + chain_code: ChainCode::new(c), fvk, dk: DiversifierKey(dk), }) @@ -537,52 +568,14 @@ impl ExtendedFullViewingKey { pub fn write(&self, mut writer: W) -> io::Result<()> { writer.write_u8(self.depth)?; writer.write_all(&self.parent_fvk_tag.0)?; - writer.write_u32::(self.child_index.value())?; - writer.write_all(&self.chain_code.0)?; + writer.write_u32::(self.child_index.index())?; + writer.write_all(self.chain_code.as_bytes())?; writer.write_all(&self.fvk.to_bytes())?; writer.write_all(&self.dk.0)?; Ok(()) } - pub fn derive_child(&self, i: ChildIndex) -> Result { - let tmp = match i { - ChildIndex::Hardened(_) => return Err(()), - ChildIndex::NonHardened(i) => { - let mut le_i = [0; 4]; - LittleEndian::write_u32(&mut le_i, i); - prf_expand_vec( - &self.chain_code.0, - &[&[0x12], &self.fvk.to_bytes(), &self.dk.0, &le_i], - ) - } - }; - let i_l = &tmp.as_bytes()[..32]; - let mut c_i = [0u8; 32]; - c_i.copy_from_slice(&tmp.as_bytes()[32..]); - - Ok(ExtendedFullViewingKey { - depth: self.depth + 1, - parent_fvk_tag: FvkFingerprint::from(&self.fvk).tag(), - child_index: i, - chain_code: ChainCode(c_i), - fvk: { - let i_ask = jubjub::Fr::from_bytes_wide(prf_expand(i_l, &[0x13]).as_array()); - let i_nsk = jubjub::Fr::from_bytes_wide(prf_expand(i_l, &[0x14]).as_array()); - let ak = (SPENDING_KEY_GENERATOR * i_ask) + self.fvk.vk.ak; - let nk = NullifierDerivingKey( - (PROOF_GENERATION_KEY_GENERATOR * i_nsk) + self.fvk.vk.nk.0, - ); - - FullViewingKey { - vk: ViewingKey { ak, nk }, - ovk: derive_child_ovk(&self.fvk.ovk, i_l), - } - }, - dk: self.dk.derive_child(i_l), - }) - } - /// Attempt to produce a payment address given the specified diversifier /// index, and return None if the specified index does not produce a valid /// diversifier. @@ -812,43 +805,14 @@ mod tests { use ff::PrimeField; use group::GroupEncoding; - #[test] - #[allow(deprecated)] - fn derive_nonhardened_child() { - let seed = [0; 32]; - let xsk_m = ExtendedSpendingKey::master(&seed); - let xfvk_m = xsk_m.to_extended_full_viewing_key(); - - let i_5 = ChildIndex::NonHardened(5); - let xsk_5 = xsk_m.derive_child(i_5); - let xfvk_5 = xfvk_m.derive_child(i_5); - - assert!(xfvk_5.is_ok()); - assert_eq!(xsk_5.to_extended_full_viewing_key(), xfvk_5.unwrap()); - } - #[test] #[allow(deprecated)] fn derive_hardened_child() { let seed = [0; 32]; let xsk_m = ExtendedSpendingKey::master(&seed); - let xfvk_m = xsk_m.to_extended_full_viewing_key(); - let i_5h = ChildIndex::Hardened(5); - let xsk_5h = xsk_m.derive_child(i_5h); - let xfvk_5h = xfvk_m.derive_child(i_5h); - - // Cannot derive a hardened child from an ExtendedFullViewingKey - assert!(xfvk_5h.is_err()); - let xfvk_5h = xsk_5h.to_extended_full_viewing_key(); - - let i_7 = ChildIndex::NonHardened(7); - let xsk_5h_7 = xsk_5h.derive_child(i_7); - let xfvk_5h_7 = xfvk_5h.derive_child(i_7); - - // But we *can* derive a non-hardened child from a hardened parent - assert!(xfvk_5h_7.is_ok()); - assert_eq!(xsk_5h_7.to_extended_full_viewing_key(), xfvk_5h_7.unwrap()); + let i_5h = ChildIndex::hardened(5); + let _ = xsk_m.derive_child(i_5h); } #[test] @@ -856,17 +820,17 @@ mod tests { let seed = [0; 32]; let xsk_m = ExtendedSpendingKey::master(&seed); - let xsk_5h = xsk_m.derive_child(ChildIndex::Hardened(5)); + let xsk_5h = xsk_m.derive_child(ChildIndex::hardened(5)); assert_eq!( - ExtendedSpendingKey::from_path(&xsk_m, &[ChildIndex::Hardened(5)]), + ExtendedSpendingKey::from_path(&xsk_m, &[ChildIndex::hardened(5)]), xsk_5h ); - let xsk_5h_7 = xsk_5h.derive_child(ChildIndex::NonHardened(7)); + let xsk_5h_7 = xsk_5h.derive_child(ChildIndex::hardened(7)); assert_eq!( ExtendedSpendingKey::from_path( &xsk_m, - &[ChildIndex::Hardened(5), ChildIndex::NonHardened(7)] + &[ChildIndex::hardened(5), ChildIndex::hardened(7)] ), xsk_5h_7 ); @@ -1193,506 +1157,431 @@ mod tests { }, TestVector { ask: Some([ - 0x28, 0x2b, 0xc1, 0x97, 0xa5, 0x16, 0x28, 0x7c, 0x8e, 0xa8, 0xf6, 0x8c, 0x42, - 0x4a, 0xba, 0xd3, 0x02, 0xb4, 0x5c, 0xdf, 0x95, 0x40, 0x79, 0x61, 0xd7, 0xb8, - 0xb4, 0x55, 0x26, 0x7a, 0x35, 0x0c, + 0xd5, 0xf7, 0xe9, 0x2e, 0xfb, 0x7a, 0xbe, 0x04, 0xdc, 0x8c, 0x14, 0x8b, 0x0b, + 0x3b, 0x0f, 0xc2, 0x3e, 0x04, 0x29, 0xf0, 0x02, 0x08, 0xff, 0x93, 0xb6, 0x8d, + 0x21, 0xa6, 0xe1, 0x31, 0xbd, 0x04, ]), nsk: Some([ - 0xe7, 0xa3, 0x29, 0x88, 0xfd, 0xca, 0x1e, 0xfc, 0xd6, 0xd1, 0xc4, 0xc5, 0x62, - 0xe6, 0x29, 0xc2, 0xe9, 0x6b, 0x2c, 0x3f, 0x7e, 0xda, 0x04, 0xac, 0x4e, 0xfd, - 0x18, 0x10, 0xff, 0x6b, 0xba, 0x01, + 0x37, 0x2a, 0x7c, 0x68, 0x22, 0xcb, 0xe6, 0x03, 0xf3, 0x46, 0x5c, 0x4b, 0x9b, + 0x65, 0x58, 0xf3, 0xa3, 0x51, 0x2d, 0xec, 0xd4, 0x34, 0x01, 0x2e, 0x67, 0xbf, + 0xfc, 0xf6, 0x57, 0xe5, 0x75, 0x0a, ]), ovk: [ - 0x5f, 0x13, 0x81, 0xfc, 0x88, 0x86, 0xda, 0x6a, 0x02, 0xdf, 0xfe, 0xef, 0xcf, - 0x50, 0x3c, 0x40, 0xfa, 0x8f, 0x5a, 0x36, 0xf7, 0xa7, 0x14, 0x2f, 0xd8, 0x1b, - 0x55, 0x18, 0xc5, 0xa4, 0x74, 0x74, + 0x25, 0x30, 0x76, 0x19, 0x33, 0x34, 0x8c, 0x1f, 0xcf, 0x14, 0x35, 0x54, 0x33, + 0xa8, 0xd2, 0x91, 0x16, 0x7f, 0xbb, 0x37, 0xb2, 0xce, 0x37, 0xca, 0x97, 0x16, + 0x0a, 0x47, 0xec, 0x33, 0x1c, 0x69, ], dk: [ - 0xe0, 0x4d, 0xe8, 0x32, 0xa2, 0xd7, 0x91, 0xec, 0x12, 0x9a, 0xb9, 0x00, 0x2b, - 0x91, 0xc9, 0xe9, 0xcd, 0xee, 0xd7, 0x92, 0x41, 0xa7, 0xc4, 0x96, 0x0e, 0x51, - 0x78, 0xd8, 0x70, 0xc1, 0xb4, 0xdc, + 0xf2, 0x88, 0x40, 0x0f, 0xd6, 0x5f, 0x9a, 0xdf, 0xe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, - 0xec, 0xeb, 0x41, 0xba, 0x45, 0x2a, + 0x51, 0x3d, 0xe6, 0x40, 0x85, 0xd3, 0x5a, 0x3a, 0xdf, 0x23, 0xd8, 0x9d, 0x5a, + 0x21, 0xcd, 0xee, 0x4d, 0xb4, 0xc6, 0x25, 0xbd, 0x6a, 0x3c, 0x3c, 0x62, 0x4b, + 0xef, 0x43, 0x44, 0x14, 0x1d, 0xeb, ], ivk: [ - 0x15, 0x5a, 0x8e, 0xe2, 0x05, 0xd3, 0x87, 0x2d, 0x12, 0xf8, 0xa3, 0xe6, 0x39, - 0x91, 0x46, 0x33, 0xc2, 0x3c, 0xde, 0x1f, 0x30, 0xed, 0x50, 0x51, 0xe5, 0x21, - 0x30, 0xb1, 0xd0, 0x10, 0x4c, 0x06, + 0xf6, 0xe7, 0x5c, 0xd9, 0x80, 0xc3, 0x0e, 0xab, 0xc6, 0x1f, 0x49, 0xac, 0x68, + 0xf4, 0x88, 0x57, 0x3a, 0xb3, 0xe6, 0xaf, 0xe1, 0x53, 0x76, 0x37, 0x5d, 0x34, + 0xe4, 0x06, 0x70, 0x2f, 0xfd, 0x02, ], xsk: Some([ - 0x01, 0x14, 0xc2, 0x71, 0x3a, 0x01, 0x00, 0x00, 0x00, 0x01, 0x47, 0x11, 0x0c, - 0x69, 0x1a, 0x03, 0xb9, 0xd9, 0xf0, 0xba, 0x90, 0x05, 0xc5, 0xe7, 0x90, 0xa5, - 0x95, 0xb7, 0xf0, 0x4e, 0x33, 0x29, 0xd2, 0xfa, 0x43, 0x8a, 0x67, 0x05, 0xda, - 0xbc, 0xe6, 0x28, 0x2b, 0xc1, 0x97, 0xa5, 0x16, 0x28, 0x7c, 0x8e, 0xa8, 0xf6, - 0x8c, 0x42, 0x4a, 0xba, 0xd3, 0x02, 0xb4, 0x5c, 0xdf, 0x95, 0x40, 0x79, 0x61, - 0xd7, 0xb8, 0xb4, 0x55, 0x26, 0x7a, 0x35, 0x0c, 0xe7, 0xa3, 0x29, 0x88, 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 0xa3, 0x51, + 0x2d, 0xec, 0xd4, 0x34, 0x01, 0x2e, 0x67, 0xbf, 0xfc, 0xf6, 0x57, 0xe5, 0x75, + 0x0a, 0x25, 0x30, 0x76, 0x19, 0x33, 0x34, 0x8c, 0x1f, 0xcf, 0x14, 0x35, 0x54, + 0x33, 0xa8, 0xd2, 0x91, 0x16, 0x7f, 0xbb, 0x37, 0xb2, 0xce, 0x37, 0xca, 0x97, + 0x16, 0x0a, 0x47, 0xec, 0x33, 0x1c, 0x69, 0xf2, 0x88, 0x40, 0x0f, 0xd6, 0x5f, + 0x9a, 0xdf, 0xe3, 0xa7, 0xc3, 0x72, 0x0a, 0xce, 0xee, 0x0d, 0xae, 0x05, 0x0d, + 0x0a, 0x81, 0x9d, 0x61, 0x9f, 0x92, 0xe9, 0xe2, 0xcb, 0x44, 0x34, 0xd5, 0x26, ]), xfvk: [ - 0x01, 0x14, 0xc2, 0x71, 0x3a, 0x01, 0x00, 0x00, 0x00, 0x01, 0x47, 0x11, 0x0c, - 0x69, 0x1a, 0x03, 0xb9, 0xd9, 0xf0, 0xba, 0x90, 0x05, 0xc5, 0xe7, 0x90, 0xa5, - 0x95, 0xb7, 0xf0, 0x4e, 0x33, 0x29, 0xd2, 0xfa, 0x43, 0x8a, 0x67, 0x05, 0xda, - 0xbc, 0xe6, 0xdc, 0x14, 0xb5, 0x14, 0xd3, 0xa9, 0x25, 0x94, 0xc2, 0x19, 0x25, - 0xaf, 0x2f, 0x77, 0x65, 0xa5, 0x47, 0xb3, 0x0e, 0x73, 0xfa, 0x7b, 0x70, 0x0e, - 0xa1, 0xbf, 0xf2, 0xe5, 0xef, 0xaa, 0xa8, 0x8b, 0x61, 0x52, 0xeb, 0x7f, 0xdb, - 0x25, 0x27, 0x79, 0xdd, 0xcb, 0x95, 0xd2, 0x17, 0xea, 0x4b, 0x6f, 0xd3, 0x40, - 0x36, 0xe9, 0xad, 0xad, 0xb3, 0xb5, 0xc9, 0xcb, 0xec, 0xeb, 0x41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x14, 0x35, 0x54, + 0x33, 0xa8, 0xd2, 0x91, 0x16, 0x7f, 0xbb, 0x37, 0xb2, 0xce, 0x37, 0xca, 0x97, + 0x16, 0x0a, 0x47, 0xec, 0x33, 0x1c, 0x69, 0xf2, 0x88, 0x40, 0x0f, 0xd6, 0x5f, + 0x9a, 0xdf, 0xe3, 0xa7, 0xc3, 0x72, 0x0a, 0xce, 0xee, 0x0d, 0xae, 0x05, 0x0d, + 0x0a, 0x81, 0x9d, 0x61, 0x9f, 0x92, 0xe9, 0xe2, 0xcb, 0x44, 0x34, 0xd5, 0x26, ], fp: [ - 0xdb, 0x99, 0x9e, 0x07, 0x1d, 0xcb, 0x58, 0xdd, 0x93, 0x02, 0x9a, 0xe6, 0x97, - 0x05, 0x3e, 0x90, 0xed, 0xb3, 0x59, 0xd1, 0xa1, 0xb7, 0xa1, 0x25, 0x16, 0x7e, - 0xfb, 0xe9, 0x28, 0x06, 0x84, 0x23, + 0x76, 0x84, 0x23, 0xcb, 0x88, 0xd2, 0x2d, 0xee, 0x91, 0xb5, 0xb7, 0x66, 0x1e, + 0x72, 0xed, 0x00, 0x95, 0x57, 0xeb, 0xa1, 0x44, 0xc7, 0x8d, 0x1a, 0xa7, 0x1a, + 0x3e, 0x88, 0xb6, 0x91, 0x06, 0x96, ], - d0: Some([ - 0x8b, 0x41, 0x38, 0x32, 0x0d, 0xfa, 0xfd, 0x7b, 0x39, 0x97, 0x81, - ]), - d1: None, - d2: Some([ - 0x57, 0x49, 0xa1, 0x33, 0x52, 0xbc, 0x22, 0x3e, 0x30, 0x80, 0x78, + d0: None, + d1: Some([ + 0xbc, 0xc3, 0x23, 0xe8, 0xda, 0x39, 0xb4, 0x96, 0xc0, 0x50, 0x51, ]), + d2: None, dmax: Some([ - 0x63, 0x89, 0x57, 0x4c, 0xde, 0x0f, 0xbb, 0xc6, 0x36, 0x81, 0x31, + 0x25, 0x14, 0x32, 0x0d, 0x33, 0x9c, 0x66, 0x6a, 0x25, 0x4c, 0x06, ]), internal_nsk: Some([ - 0x74, 0x92, 0x9f, 0x79, 0x0c, 0x11, 0xdc, 0xab, 0x3a, 0x2f, 0x93, 0x12, 0x35, - 0xcd, 0xb2, 0x67, 0xf5, 0xa3, 0x1b, 0x9f, 0x13, 0x9f, 0x2c, 0x9f, 0xd8, 0x16, - 0xb0, 0x44, 0x4f, 0xb8, 0x05, 0x05, + 0x5d, 0x47, 0x0f, 0x97, 0x79, 0xcc, 0x25, 0x7f, 0x21, 0x28, 0x8f, 0x50, 0x5a, + 0x4e, 0x65, 0xb3, 0x8e, 0xb8, 0x53, 0xf1, 0xa2, 0x45, 0x63, 0xb9, 0xf6, 0x74, + 0x17, 0x26, 0xf4, 0xd3, 0x01, 0x03, ]), internal_ovk: [ - 0x0c, 0xd4, 0xd7, 0xc5, 0xcc, 0x7f, 0x53, 0x4b, 0x96, 0xd2, 0x41, 0x82, 0xa3, - 0x14, 0x65, 0xb4, 0x78, 0x11, 0x05, 0x48, 0x9c, 0xd1, 0x0d, 0x50, 0x0c, 0xf5, - 0x29, 0x5a, 0x6f, 0xd8, 0x18, 0xcc, + 0x78, 0x64, 0xe8, 0xc7, 0x9c, 0xea, 0xab, 0x97, 0xe6, 0xae, 0x5b, 0xca, 0x10, + 0xf7, 0xd5, 0x1d, 0xf4, 0x20, 0x9a, 0xd0, 0xd4, 0x6e, 0x80, 0xac, 0x18, 0x0d, + 0x50, 0xd3, 0xff, 0x09, 0xa6, 0x70, ], internal_dk: [ - 0xd2, 0x78, 0xb7, 0x2c, 0x62, 0x1d, 0x19, 0xcb, 0x00, 0xf9, 0x70, 0x07, 0x9c, - 0x89, 0x22, 0x76, 0x1c, 0xdd, 0x3a, 0xe7, 0xf2, 0x7b, 0x18, 0x47, 0xc5, 0x53, - 0x60, 0xdb, 0xeb, 0xf6, 0x54, 0x92, + 0x54, 0xf1, 0x1e, 0x3f, 0xa3, 0x0d, 0x34, 0xd6, 0xa7, 0x4d, 0xef, 0x1e, 0x6d, + 0x5d, 0xaf, 0x58, 0xcf, 0xc7, 0xd7, 0x8b, 0x27, 0xcb, 0x07, 0x15, 0xc1, 0xaf, + 0xfa, 0x29, 0xae, 0x39, 0x92, 0xfa, ], internal_nk: [ - 0x2b, 0x5c, 0x78, 0xa2, 0xfb, 0xa5, 0x01, 0x9c, 0x15, 0xa7, 0x51, 0x50, 0x2b, - 0xa9, 0x91, 0x6f, 0xae, 0xda, 0xe1, 0xfc, 0x14, 0xdc, 0x81, 0xb0, 0xb8, 0x35, - 0xf2, 0xbf, 0x95, 0xc0, 0x68, 0xe8, + 0x31, 0x42, 0x48, 0x75, 0xd6, 0xa5, 0xed, 0x75, 0xde, 0x20, 0x0b, 0xb5, 0xc1, + 0xd8, 0x1a, 0xec, 0x4d, 0xff, 0x16, 0x50, 0xb7, 0x8b, 0xb0, 0xca, 0xde, 0x3c, + 0x8c, 0x7a, 0xb0, 0x3d, 0xf1, 0x11, ], internal_ivk: [ - 0xdf, 0x44, 0x54, 0xa6, 0x76, 0xd1, 0xde, 0x32, 0xe2, 0x0a, 0xe6, 0x28, 0x7a, - 0x92, 0xfa, 0xfe, 0xfb, 0xbb, 0x3e, 0x54, 0xb5, 0x88, 0xc8, 0xda, 0x28, 0x07, - 0xec, 0x43, 0x68, 0x2c, 0x85, 0x00, + 0xe5, 0x42, 0x6b, 0x5b, 0x80, 0xb1, 0x18, 0x67, 0x97, 0x01, 0x65, 0x80, 0xc1, + 0xf4, 0x1c, 0x34, 0x19, 0x68, 0x3a, 0xac, 0x77, 0xcf, 0x8d, 0xe0, 0x2f, 0x2f, + 0x98, 0x07, 0xd1, 0x50, 0xb4, 0x02, ], internal_xsk: Some([ - 0x01, 0x14, 0xc2, 0x71, 0x3a, 0x01, 0x00, 0x00, 0x00, 0x01, 0x47, 0x11, 0x0c, - 0x69, 0x1a, 0x03, 0xb9, 0xd9, 0xf0, 0xba, 0x90, 0x05, 0xc5, 0xe7, 0x90, 0xa5, - 0x95, 0xb7, 0xf0, 0x4e, 0x33, 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9, 0x2e, 0xfb, 0x7a, 0xbe, 0x04, 0xdc, 0x8c, 0x14, + 0x8b, 0x0b, 0x3b, 0x0f, 0xc2, 0x3e, 0x04, 0x29, 0xf0, 0x02, 0x08, 0xff, 0x93, + 0xb6, 0x8d, 0x21, 0xa6, 0xe1, 0x31, 0xbd, 0x04, 0x5d, 0x47, 0x0f, 0x97, 0x79, + 0xcc, 0x25, 0x7f, 0x21, 0x28, 0x8f, 0x50, 0x5a, 0x4e, 0x65, 0xb3, 0x8e, 0xb8, + 0x53, 0xf1, 0xa2, 0x45, 0x63, 0xb9, 0xf6, 0x74, 0x17, 0x26, 0xf4, 0xd3, 0x01, + 0x03, 0x78, 0x64, 0xe8, 0xc7, 0x9c, 0xea, 0xab, 0x97, 0xe6, 0xae, 0x5b, 0xca, + 0x10, 0xf7, 0xd5, 0x1d, 0xf4, 0x20, 0x9a, 0xd0, 0xd4, 0x6e, 0x80, 0xac, 0x18, + 0x0d, 0x50, 0xd3, 0xff, 0x09, 0xa6, 0x70, 0x54, 0xf1, 0x1e, 0x3f, 0xa3, 0x0d, + 0x34, 0xd6, 0xa7, 0x4d, 0xef, 0x1e, 0x6d, 0x5d, 0xaf, 0x58, 0xcf, 0xc7, 0xd7, + 0x8b, 0x27, 0xcb, 0x07, 0x15, 0xc1, 0xaf, 0xfa, 0x29, 0xae, 0x39, 0x92, 0xfa, ]), internal_xfvk: [ - 0x01, 0x14, 0xc2, 0x71, 0x3a, 0x01, 0x00, 0x00, 0x00, 0x01, 0x47, 0x11, 0x0c, - 0x69, 0x1a, 0x03, 0xb9, 0xd9, 0xf0, 0xba, 0x90, 0x05, 0xc5, 0xe7, 0x90, 0xa5, - 0x95, 0xb7, 0xf0, 0x4e, 0x33, 0x29, 0xd2, 0xfa, 0x43, 0x8a, 0x67, 0x05, 0xda, - 0xbc, 0xe6, 0xdc, 0x14, 0xb5, 0x14, 0xd3, 0xa9, 0x25, 0x94, 0xc2, 0x19, 0x25, - 0xaf, 0x2f, 0x77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, 0xbd, 0xe9, 0xa8, 0xa3, 0x5f, 0x53, 0x31, 0x42, 0x48, 0x75, 0xd6, + 0xa5, 0xed, 0x75, 0xde, 0x20, 0x0b, 0xb5, 0xc1, 0xd8, 0x1a, 0xec, 0x4d, 0xff, + 0x16, 0x50, 0xb7, 0x8b, 0xb0, 0xca, 0xde, 0x3c, 0x8c, 0x7a, 0xb0, 0x3d, 0xf1, + 0x11, 0x78, 0x64, 0xe8, 0xc7, 0x9c, 0xea, 0xab, 0x97, 0xe6, 0xae, 0x5b, 0xca, + 0x10, 0xf7, 0xd5, 0x1d, 0xf4, 0x20, 0x9a, 0xd0, 0xd4, 0x6e, 0x80, 0xac, 0x18, + 0x0d, 0x50, 0xd3, 0xff, 0x09, 0xa6, 0x70, 0x54, 0xf1, 0x1e, 0x3f, 0xa3, 0x0d, + 0x34, 0xd6, 0xa7, 0x4d, 0xef, 0x1e, 0x6d, 0x5d, 0xaf, 0x58, 0xcf, 0xc7, 0xd7, + 0x8b, 0x27, 0xcb, 0x07, 0x15, 0xc1, 0xaf, 0xfa, 0x29, 0xae, 0x39, 0x92, 0xfa, ], internal_fp: [ - 0x0d, 0xe5, 0x83, 0xca, 0x50, 0x2b, 0x1c, 0x4b, 0x87, 0xca, 0xc8, 0xc9, 0x78, - 0x6c, 0x61, 0x9b, 0x79, 0xe1, 0x69, 0xb4, 0x15, 0x61, 0xf2, 0x44, 0xee, 0xec, - 0x86, 0x86, 0xb8, 0xdb, 0xc4, 0xe1, + 0x12, 0x87, 0xc3, 0x79, 0x02, 0x35, 0x69, 0x16, 0x4e, 0xb5, 0x23, 0xff, 0xdd, + 0x72, 0x03, 0x1c, 0x35, 0xe1, 0x85, 0x9f, 0x3e, 0xf8, 0xd4, 0x83, 0x0a, 0x29, + 0x91, 0xba, 0x7e, 0x15, 0xde, 0x2d, ], }, TestVector { ask: Some([ - 0x8b, 0xe8, 0x11, 0x3c, 0xee, 0x34, 0x13, 0xa7, 0x1f, 0x82, 0xc4, 0x1f, 0xc8, - 0xda, 0x51, 0x7b, 0xe1, 0x34, 0x04, 0x98, 0x32, 0xe6, 0x82, 0x5c, 0x92, 0xda, - 0x6b, 0x84, 0xfe, 0xe4, 0xc6, 0x0d, + 0x7f, 0xf3, 0x5d, 0xb6, 0x9e, 0x13, 0xc3, 0x6f, 0x59, 0xad, 0x9c, 0x08, 0xd3, + 0x2d, 0x52, 0x27, 0x37, 0x8d, 0xa0, 0xcf, 0xf9, 0x71, 0xfd, 0x42, 0x4b, 0xae, + 0xf9, 0xa6, 0x33, 0x2f, 0x51, 0x06, ]), nsk: Some([ - 0x37, 0x78, 0x05, 0x9d, 0xc5, 0x69, 0xe7, 0xd0, 0xd3, 0x23, 0x91, 0x57, 0x3f, - 0x95, 0x1b, 0xbd, 0xe9, 0x2f, 0xc6, 0xb9, 0xcf, 0x61, 0x47, 0x73, 0x66, 0x1c, - 0x5c, 0x27, 0x3a, 0xa6, 0x99, 0x0c, + 0x77, 0x9c, 0x6e, 0xe4, 0xa0, 0x39, 0x44, 0xeb, 0xa2, 0x8b, 0xc9, 0xbd, 0xc1, + 0x32, 0x9a, 0x39, 0x14, 0x07, 0xf4, 0x8c, 0x41, 0x0d, 0x5a, 0xe0, 0xa3, 0x64, + 0xf5, 0x99, 0x59, 0xbf, 0xde, 0x00, ]), ovk: [ - 0xcf, 0x81, 0x18, 0x2e, 0x96, 0x22, 0x3c, 0x02, 0x8c, 0xe3, 0xd6, 0xeb, 0x47, - 0x94, 0xd3, 0x11, 0x3b, 0x95, 0x06, 0x9d, 0x14, 0xc5, 0x75, 0x88, 0xe1, 0x93, - 0xb6, 0x5e, 0xfc, 0x28, 0x13, 0xbc, + 0xd9, 0xfc, 0x71, 0x01, 0xbf, 0x90, 0x7f, 0x41, 0x88, 0x6a, 0x73, 0x30, 0xa5, + 0xd6, 0xa7, 0xbd, 0x23, 0x53, 0x5e, 0x30, 0x5e, 0xb7, 0x67, 0x9b, 0xc2, 0x3d, + 0x76, 0x05, 0x93, 0x61, 0x85, 0xac, ], dk: [ - 0xa3, 0xed, 0xa1, 0x9f, 0x9e, 0xff, 0x46, 0xca, 0x12, 0xdf, 0xa1, 0xbf, 0x10, - 0x37, 0x1b, 0x48, 0xd1, 0xb4, 0xa4, 0x0c, 0x4d, 0x05, 0xa0, 0xd8, 0xdc, 0xe0, - 0xe7, 0xdc, 0x62, 0xb0, 0x7b, 0x37, + 0xe4, 0x69, 0x9e, 0x9a, 0x86, 0xe0, 0x31, 0xc5, 0x4b, 0x21, 0xcd, 0xd0, 0x96, + 0x0a, 0xc1, 0x8d, 0xdd, 0x61, 0xec, 0x9f, 0x7a, 0xe9, 0x8d, 0x55, 0x82, 0xa6, + 0xfa, 0xf6, 0x5f, 0x32, 0x48, 0xd1, ], c: [ - 0x97, 0xce, 0x15, 0xf4, 0xed, 0x1b, 0x97, 0x39, 0xb0, 0x26, 0x2a, 0x46, 0x3b, - 0xcb, 0x3d, 0xc9, 0xb3, 0xbd, 0x23, 0x23, 0xa9, 0xba, 0xa4, 0x41, 0xca, 0x42, - 0x77, 0x73, 0x83, 0xa8, 0xd4, 0x35, + 0x44, 0x79, 0x08, 0x6c, 0x75, 0xd0, 0x80, 0x79, 0x60, 0x20, 0xf5, 0x00, 0xc1, + 0xe3, 0x0a, 0x54, 0xcf, 0xe2, 0x9d, 0xda, 0x36, 0xf2, 0x14, 0x4f, 0xb3, 0x3a, + 0x50, 0x80, 0x6f, 0xbe, 0xf7, 0xda, ], ak: [ - 0xa6, 0xc5, 0x92, 0x5a, 0x0f, 0x85, 0xfa, 0x4f, 0x1e, 0x40, 0x5e, 0x3a, 0x49, - 0x70, 0xd0, 0xc4, 0xa4, 0xb4, 0x81, 0x44, 0x38, 0xf4, 0xe9, 0xd4, 0x52, 0x0e, - 0x20, 0xf7, 0xfd, 0xcf, 0x38, 0x41, + 0x9a, 0x85, 0x3f, 0x95, 0x44, 0x71, 0x37, 0x97, 0xe0, 0x85, 0x17, 0x64, 0xda, + 0x39, 0x2e, 0x68, 0x53, 0x4b, 0x1d, 0x94, 0x8d, 0xae, 0x47, 0x42, 0xee, 0x76, + 0x5c, 0x72, 0x75, 0x72, 0xab, 0x4e, ], nk: [ - 0x30, 0x4e, 0x30, 0x59, 0x16, 0x21, 0x6b, 0xeb, 0x7b, 0x65, 0x4d, 0x8a, 0xae, - 0x50, 0xec, 0xd1, 0x88, 0xfc, 0xb3, 0x84, 0xbc, 0x36, 0xc0, 0x0c, 0x66, 0x4f, - 0x30, 0x77, 0x25, 0xe2, 0xee, 0x11, + 0xf1, 0x66, 0xa2, 0x8a, 0x4f, 0x88, 0xce, 0xc1, 0x21, 0x41, 0xa8, 0x2d, 0x21, + 0x20, 0xbd, 0x6d, 0x8c, 0xaf, 0x87, 0x9c, 0x9a, 0x1b, 0x3a, 0xd2, 0x11, 0x85, + 0x01, 0x36, 0x4f, 0x5d, 0x4f, 0xbe, ], ivk: [ - 0xa2, 0xa1, 0x3c, 0x1e, 0x38, 0xb4, 0x59, 0x84, 0x44, 0x58, 0x03, 0xe4, 0x30, - 0xa6, 0x83, 0xc9, 0x0b, 0xb2, 0xe1, 0x4d, 0x4c, 0x86, 0x92, 0xff, 0x25, 0x3a, - 0x64, 0x84, 0xdd, 0x9b, 0xb5, 0x04, + 0x33, 0xbd, 0x46, 0x01, 0x5a, 0x2c, 0xad, 0x17, 0xd6, 0xe0, 0x15, 0xeb, 0x88, + 0x86, 0x1b, 0x0c, 0x91, 0x77, 0x96, 0x24, 0x65, 0x70, 0x52, 0x1c, 0x9e, 0x1a, + 0xe4, 0xb1, 0xc8, 0x31, 0x1d, 0x06, ], xsk: Some([ - 0x02, 0xdb, 0x99, 0x9e, 0x07, 0x02, 0x00, 0x00, 0x80, 0x97, 0xce, 0x15, 0xf4, - 0xed, 0x1b, 0x97, 0x39, 0xb0, 0x26, 0x2a, 0x46, 0x3b, 0xcb, 0x3d, 0xc9, 0xb3, - 0xbd, 0x23, 0x23, 0xa9, 0xba, 0xa4, 0x41, 0xca, 0x42, 0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44, 0x38, 0xf4, 0xe9, 0xd4, - 0x52, 0x0e, 0x20, 0xf7, 0xfd, 0xcf, 0x38, 0x41, 0x30, 0x4e, 0x30, 0x59, 0x16, - 0x21, 0x6b, 0xeb, 0x7b, 0x65, 0x4d, 0x8a, 0xae, 0x50, 0xec, 0xd1, 0x88, 0xfc, - 0xb3, 0x84, 0xbc, 0x36, 0xc0, 0x0c, 0x66, 0x4f, 0x30, 0x77, 0x25, 0xe2, 0xee, - 0x11, 0xcf, 0x81, 0x18, 0x2e, 0x96, 0x22, 0x3c, 0x02, 0x8c, 0xe3, 0xd6, 0xeb, - 0x47, 0x94, 0xd3, 0x11, 0x3b, 0x95, 0x06, 0x9d, 0x14, 0xc5, 0x75, 0x88, 0xe1, - 0x93, 0xb6, 0x5e, 0xfc, 0x28, 0x13, 0xbc, 0xa3, 0xed, 0xa1, 0x9f, 0x9e, 0xff, - 0x46, 0xca, 0x12, 0xdf, 0xa1, 0xbf, 0x10, 0x37, 0x1b, 0x48, 0xd1, 0xb4, 0xa4, - 0x0c, 0x4d, 0x05, 0xa0, 0xd8, 0xdc, 0xe0, 0xe7, 0xdc, 0x62, 0xb0, 0x7b, 0x37, + 0x02, 0x76, 0x84, 0x23, 0xcb, 0x02, 0x00, 0x00, 0x80, 0x44, 0x79, 0x08, 0x6c, + 0x75, 0xd0, 0x80, 0x79, 0x60, 0x20, 0xf5, 0x00, 0xc1, 0xe3, 0x0a, 0x54, 0xcf, + 0xe2, 0x9d, 0xda, 0x36, 0xf2, 0x14, 0x4f, 0xb3, 0x3a, 0x50, 0x80, 0x6f, 0xbe, + 0xf7, 0xda, 0x9a, 0x85, 0x3f, 0x95, 0x44, 0x71, 0x37, 0x97, 0xe0, 0x85, 0x17, + 0x64, 0xda, 0x39, 0x2e, 0x68, 0x53, 0x4b, 0x1d, 0x94, 0x8d, 0xae, 0x47, 0x42, + 0xee, 0x76, 0x5c, 0x72, 0x75, 0x72, 0xab, 0x4e, 0xf1, 0x66, 0xa2, 0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 0x3e, 0x89, 0x9f, 0x68, - ]), + d0: None, + d1: None, d2: None, dmax: None, internal_nsk: Some([ - 0x34, 0x78, 0x65, 0xac, 0xf4, 0x7e, 0x50, 0x45, 0x38, 0xf5, 0xef, 0x8b, 0x04, - 0x70, 0x20, 0x80, 0xe6, 0x09, 0x1c, 0xda, 0x57, 0x97, 0xcd, 0x7d, 0x23, 0x5a, - 0x54, 0x6e, 0xb1, 0x0f, 0x55, 0x08, + 0x7b, 0x17, 0x17, 0x65, 0x27, 0xf9, 0x17, 0x99, 0x0f, 0x9f, 0x51, 0x79, 0xcb, + 0x23, 0xc1, 0x6e, 0xc0, 0xa9, 0x26, 0xed, 0xc4, 0x1a, 0xb2, 0xba, 0x42, 0x13, + 0x7b, 0xef, 0x5c, 0x20, 0x9f, 0x09, ]), internal_ovk: [ - 0xdd, 0xba, 0xc2, 0xa4, 0x93, 0xf5, 0x3c, 0x3b, 0x09, 0x33, 0xd9, 0x13, 0xde, - 0xf8, 0x88, 0x48, 0x65, 0x4c, 0x08, 0x7c, 0x12, 0x60, 0x9d, 0xf0, 0x1b, 0xaf, - 0x94, 0x05, 0xce, 0x78, 0x04, 0xfd, + 0xc6, 0x12, 0xcb, 0xc9, 0x77, 0x30, 0x7e, 0x53, 0x52, 0xa1, 0x58, 0x8b, 0xd7, + 0x0f, 0x41, 0xaf, 0x11, 0xe7, 0x3b, 0x7b, 0xc6, 0xbc, 0xbc, 0x73, 0x2a, 0xa3, + 0x06, 0xc2, 0x1c, 0xd0, 0x0f, 0x3a, ], internal_dk: [ - 0x60, 0x2c, 0xd3, 0x17, 0xb7, 0xce, 0xa1, 0x1e, 0x8c, 0xc7, 0xae, 0x2e, 0xa4, - 0x05, 0xb4, 0x0d, 0x46, 0xb1, 0x59, 0x2a, 0x30, 0xf0, 0xcb, 0x6e, 0x8c, 0x4f, - 0x17, 0xd7, 0xf7, 0xc4, 0x7f, 0xeb, + 0x35, 0xef, 0x4d, 0x26, 0x59, 0x51, 0xdc, 0xaa, 0xec, 0x26, 0xef, 0x8f, 0xbd, + 0xf8, 0x4c, 0x92, 0xb7, 0x90, 0x04, 0x9d, 0x09, 0x93, 0x77, 0x2e, 0xfb, 0x43, + 0x97, 0xf0, 0x49, 0x30, 0xf1, 0x67, ], internal_nk: [ - 0xf9, 0x12, 0x87, 0xc0, 0x6e, 0x30, 0xb6, 0x5e, 0xa1, 0xbd, 0xb7, 0x16, 0xb2, - 0x31, 0xde, 0x67, 0x78, 0xa5, 0xd8, 0x0e, 0xe5, 0xcd, 0x9c, 0x06, 0x0d, 0x1a, - 0xba, 0xca, 0xe0, 0xaa, 0xe2, 0x3b, + 0x8d, 0x05, 0x55, 0xe8, 0xe0, 0x20, 0xc9, 0xd3, 0x60, 0x68, 0x5d, 0x24, 0x2f, + 0x2b, 0xa9, 0xf7, 0x74, 0x61, 0x3f, 0xa0, 0x94, 0x01, 0xf1, 0x25, 0xbc, 0xa9, + 0x29, 0xec, 0xa4, 0x86, 0xa3, 0xd1, ], internal_ivk: [ - 0x1d, 0x59, 0xea, 0x20, 0x17, 0x88, 0x18, 0x64, 0xd2, 0x4e, 0xad, 0xb5, 0xcf, - 0x34, 0x68, 0xa4, 0x1a, 0x1b, 0x2a, 0xaa, 0x0d, 0x1b, 0x3a, 0x72, 0xc6, 0xda, - 0x9c, 0xe6, 0x50, 0x2a, 0x0a, 0x05, + 0x7f, 0x7c, 0xee, 0xfa, 0x65, 0x42, 0x8e, 0x8b, 0x70, 0x76, 0x19, 0x1a, 0x23, + 0x93, 0x95, 0x7b, 0x9c, 0x09, 0x50, 0x61, 0xd8, 0xcc, 0xe1, 0x28, 0x3d, 0xd1, + 0x5c, 0x2b, 0x5e, 0x8f, 0xc3, 0x05, ], internal_xsk: Some([ - 0x02, 0xdb, 0x99, 0x9e, 0x07, 0x02, 0x00, 0x00, 0x80, 0x97, 0xce, 0x15, 0xf4, - 0xed, 0x1b, 0x97, 0x39, 0xb0, 0x26, 0x2a, 0x46, 0x3b, 0xcb, 0x3d, 0xc9, 0xb3, - 0xbd, 0x23, 0x23, 0xa9, 0xba, 0xa4, 0x41, 0xca, 0x42, 0x77, 0x73, 0x83, 0xa8, - 0xd4, 0x35, 0x8b, 0xe8, 0x11, 0x3c, 0xee, 0x34, 0x13, 0xa7, 0x1f, 0x82, 0xc4, - 0x1f, 0xc8, 0xda, 0x51, 0x7b, 0xe1, 0x34, 0x04, 0x98, 0x32, 0xe6, 0x82, 0x5c, - 0x92, 0xda, 0x6b, 0x84, 0xfe, 0xe4, 0xc6, 0x0d, 0x34, 0x78, 0x65, 0xac, 0xf4, - 0x7e, 0x50, 0x45, 0x38, 0xf5, 0xef, 0x8b, 0x04, 0x70, 0x20, 0x80, 0xe6, 0x09, - 0x1c, 0xda, 0x57, 0x97, 0xcd, 0x7d, 0x23, 0x5a, 0x54, 0x6e, 0xb1, 0x0f, 0x55, - 0x08, 0xdd, 0xba, 0xc2, 0xa4, 0x93, 0xf5, 0x3c, 0x3b, 0x09, 0x33, 0xd9, 0x13, - 0xde, 0xf8, 0x88, 0x48, 0x65, 0x4c, 0x08, 0x7c, 0x12, 0x60, 0x9d, 0xf0, 0x1b, - 0xaf, 0x94, 0x05, 0xce, 0x78, 0x04, 0xfd, 0x60, 0x2c, 0xd3, 0x17, 0xb7, 0xce, - 0xa1, 0x1e, 0x8c, 0xc7, 0xae, 0x2e, 0xa4, 0x05, 0xb4, 0x0d, 0x46, 0xb1, 0x59, - 0x2a, 0x30, 0xf0, 0xcb, 0x6e, 0x8c, 0x4f, 0x17, 0xd7, 0xf7, 0xc4, 0x7f, 0xeb, + 0x02, 0x76, 0x84, 0x23, 0xcb, 0x02, 0x00, 0x00, 0x80, 0x44, 0x79, 0x08, 0x6c, + 0x75, 0xd0, 0x80, 0x79, 0x60, 0x20, 0xf5, 0x00, 0xc1, 0xe3, 0x0a, 0x54, 0xcf, + 0xe2, 0x9d, 0xda, 0x36, 0xf2, 0x14, 0x4f, 0xb3, 0x3a, 0x50, 0x80, 0x6f, 0xbe, + 0xf7, 0xda, 0x7f, 0xf3, 0x5d, 0xb6, 0x9e, 0x13, 0xc3, 0x6f, 0x59, 0xad, 0x9c, + 0x08, 0xd3, 0x2d, 0x52, 0x27, 0x37, 0x8d, 0xa0, 0xcf, 0xf9, 0x71, 0xfd, 0x42, + 0x4b, 0xae, 0xf9, 0xa6, 0x33, 0x2f, 0x51, 0x06, 0x7b, 0x17, 0x17, 0x65, 0x27, + 0xf9, 0x17, 0x99, 0x0f, 0x9f, 0x51, 0x79, 0xcb, 0x23, 0xc1, 0x6e, 0xc0, 0xa9, + 0x26, 0xed, 0xc4, 0x1a, 0xb2, 0xba, 0x42, 0x13, 0x7b, 0xef, 0x5c, 0x20, 0x9f, + 0x09, 0xc6, 0x12, 0xcb, 0xc9, 0x77, 0x30, 0x7e, 0x53, 0x52, 0xa1, 0x58, 0x8b, + 0xd7, 0x0f, 0x41, 0xaf, 0x11, 0xe7, 0x3b, 0x7b, 0xc6, 0xbc, 0xbc, 0x73, 0x2a, + 0xa3, 0x06, 0xc2, 0x1c, 0xd0, 0x0f, 0x3a, 0x35, 0xef, 0x4d, 0x26, 0x59, 0x51, + 0xdc, 0xaa, 0xec, 0x26, 0xef, 0x8f, 0xbd, 0xf8, 0x4c, 0x92, 0xb7, 0x90, 0x04, + 0x9d, 0x09, 0x93, 0x77, 0x2e, 0xfb, 0x43, 0x97, 0xf0, 0x49, 0x30, 0xf1, 0x67, ]), internal_xfvk: [ - 0x02, 0xdb, 0x99, 0x9e, 0x07, 0x02, 0x00, 0x00, 0x80, 0x97, 0xce, 0x15, 0xf4, - 0xed, 0x1b, 0x97, 0x39, 0xb0, 0x26, 0x2a, 0x46, 0x3b, 0xcb, 0x3d, 0xc9, 0xb3, - 0xbd, 0x23, 0x23, 0xa9, 0xba, 0xa4, 0x41, 0xca, 0x42, 0x77, 0x73, 0x83, 0xa8, - 0xd4, 0x35, 0xa6, 0xc5, 0x92, 0x5a, 0x0f, 0x85, 0xfa, 0x4f, 0x1e,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, 0x42, + 0xee, 0x76, 0x5c, 0x72, 0x75, 0x72, 0xab, 0x4e, 0x8d, 0x05, 0x55, 0xe8, 0xe0, + 0x20, 0xc9, 0xd3, 0x60, 0x68, 0x5d, 0x24, 0x2f, 0x2b, 0xa9, 0xf7, 0x74, 0x61, + 0x3f, 0xa0, 0x94, 0x01, 0xf1, 0x25, 0xbc, 0xa9, 0x29, 0xec, 0xa4, 0x86, 0xa3, + 0xd1, 0xc6, 0x12, 0xcb, 0xc9, 0x77, 0x30, 0x7e, 0x53, 0x52, 0xa1, 0x58, 0x8b, + 0xd7, 0x0f, 0x41, 0xaf, 0x11, 0xe7, 0x3b, 0x7b, 0xc6, 0xbc, 0xbc, 0x73, 0x2a, + 0xa3, 0x06, 0xc2, 0x1c, 0xd0, 0x0f, 0x3a, 0x35, 0xef, 0x4d, 0x26, 0x59, 0x51, + 0xdc, 0xaa, 0xec, 0x26, 0xef, 0x8f, 0xbd, 0xf8, 0x4c, 0x92, 0xb7, 0x90, 0x04, + 0x9d, 0x09, 0x93, 0x77, 0x2e, 0xfb, 0x43, 0x97, 0xf0, 0x49, 0x30, 0xf1, 0x67, ], internal_fp: [ - 0x30, 0xfe, 0x0d, 0x61, 0x0f, 0x94, 0x7b, 0x2c, 0x26, 0x0e, 0x7b, 0x29, 0xe7, - 0x9e, 0x5c, 0x2e, 0x7d, 0x3e, 0x14, 0xab, 0xf9, 0x79, 0xf6, 0x40, 0x6d, 0x07, - 0xba, 0xf8, 0xfa, 0xdd, 0xf4, 0x95, + 0xe0, 0xba, 0xa5, 0xdb, 0xb8, 0x06, 0xc7, 0x21, 0x33, 0x3c, 0x63, 0x08, 0x34, + 0x5f, 0xc5, 0x1c, 0x2d, 0xc1, 0xe0, 0x09, 0xda, 0x04, 0x47, 0x78, 0xa3, 0xc3, + 0x29, 0x4d, 0x68, 0x17, 0xa3, 0xc4, ], }, TestVector { - ask: None, - nsk: None, + ask: Some([ + 0x45, 0x93, 0xd2, 0x4d, 0x21, 0xe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0xdc, 0x36, 0x3a, 0xaa, 0xed, 0x70, + 0x72, 0x9c, 0x10, 0x7b, 0xbb, 0x6a, ], c: [ - 0x97, 0xce, 0x15, 0xf4, 0xed, 0x1b, 0x97, 0x39, 0xb0, 0x26, 0x2a, 0x46, 0x3b, - 0xcb, 0x3d, 0xc9, 0xb3, 0xbd, 0x23, 0x23, 0xa9, 0xba, 0xa4, 0x41, 0xca, 0x42, - 0x77, 0x73, 0x83, 0xa8, 0xd4, 0x35, + 0x33, 0xdc, 0x01, 0x2d, 0x76, 0x90, 0xce, 0xd2, 0xcd, 0x2b, 0xcb, 0x2c, 0xc3, + 0xe4, 0x63, 0xe2, 0x8d, 0x8c, 0x29, 0xef, 0x3b, 0x01, 0xbe, 0x59, 0xb2, 0xbd, + 0xfc, 0x38, 0x5b, 0xbd, 0xc7, 0x4b, ], ak: [ - 0xa6, 0xc5, 0x92, 0x5a, 0x0f, 0x85, 0xfa, 0x4f, 0x1e, 0x40, 0x5e, 0x3a, 0x49, - 0x70, 0xd0, 0xc4, 0xa4, 0xb4, 0x81, 0x44, 0x38, 0xf4, 0xe9, 0xd4, 0x52, 0x0e, - 0x20, 0xf7, 0xfd, 0xcf, 0x38, 0x41, + 0x9c, 0x6d, 0x85, 0x9a, 0x75, 0x2c, 0x30, 0x5d, 0x62, 0x63, 0xde, 0x95, 0xf2, + 0xfc, 0xf7, 0x34, 0xb1, 0x26, 0xdf, 0x24, 0x56, 0xc7, 0xd3, 0x1b, 0xc6, 0x01, + 0xc8, 0xdd, 0xec, 0x40, 0x91, 0x12, ], nk: [ - 0x30, 0x4e, 0x30, 0x59, 0x16, 0x21, 0x6b, 0xeb, 0x7b, 0x65, 0x4d, 0x8a, 0xae, - 0x50, 0xec, 0xd1, 0x88, 0xfc, 0xb3, 0x84, 0xbc, 0x36, 0xc0, 0x0c, 0x66, 0x4f, - 0x30, 0x77, 0x25, 0xe2, 0xee, 0x11, + 0xd3, 0xee, 0x41, 0xf8, 0x4b, 0x5a, 0x95, 0x08, 0xb6, 0x1d, 0x29, 0xb2, 0xfb, + 0x45, 0x63, 0x6d, 0x19, 0xaa, 0x10, 0xd7, 0x82, 0xcd, 0x97, 0x8c, 0xfe, 0x67, + 0x15, 0x49, 0x2f, 0xcd, 0x22, 0x4e, ], ivk: [ - 0xa2, 0xa1, 0x3c, 0x1e, 0x38, 0xb4, 0x59, 0x84, 0x44, 0x58, 0x03, 0xe4, 0x30, - 0xa6, 0x83, 0xc9, 0x0b, 0xb2, 0xe1, 0x4d, 0x4c, 0x86, 0x92, 0xff, 0x25, 0x3a, - 0x64, 0x84, 0xdd, 0x9b, 0xb5, 0x04, + 0xd1, 0x38, 0xe1, 0x37, 0xc6, 0x67, 0x1d, 0xe7, 0x82, 0xfb, 0x01, 0xba, 0x91, + 0x1d, 0x98, 0x64, 0xbe, 0xbc, 0x44, 0x36, 0xcc, 0xb3, 0x88, 0xb4, 0xc1, 0xce, + 0x02, 0x56, 0xa8, 0xdb, 0x74, 0x01, ], - xsk: None, + xsk: Some([ + 0x03, 0x0b, 0xdc, 0x2d, 0x2b, 0x03, 0x00, 0x00, 0x80, 0x33, 0xdc, 0x01, 0x2d, + 0x76, 0x90, 0xce, 0xd2, 0xcd, 0x2b, 0xcb, 0x2c, 0xc3, 0xe4, 0x63, 0xe2, 0x8d, + 0x8c, 0x29, 0xef, 0x3b, 0x01, 0xbe, 0x59, 0xb2, 0xbd, 0xfc, 0x38, 0x5b, 0xbd, + 0xc7, 0x4b, 0x45, 0x93, 0xd2, 0x4d, 0x21, 0xe3, 0x59, 0x37, 0xf1, 0x52, 0xcf, + 0x90, 0x46, 0x1c, 0x33, 0x2f, 0x69, 0x50, 0x3c, 0x10, 0x45, 0x81, 0xd6, 0x83, + 0xe0, 0xac, 0x29, 0xf8, 0x4d, 0xec, 0xaf, 0x07, 0x1a, 0xc8, 0x7e, 0xc2, 0x12, + 0x3f, 0x50, 0x57, 0xe3, 0xc0, 0xf8, 0x58, 0xe8, 0x0d, 0xfa, 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x2e, 0x9d, 0x6c, 0xe3, 0x80, 0xa8, + 0xaf, 0x18, 0xe7, 0x5d, 0xa9, 0x22, 0x55, 0x51, 0xfb, 0xef, 0x8b, 0x98, 0x31, + 0x1b, 0x5c, 0x9c, 0x1b, 0x4b, 0x9e, 0xe3, 0x57, 0xfc, 0x6c, 0x59, 0xa4, 0xf3, + 0xad, 0x5a, 0x6f, 0x60, 0x9d, 0xb6, 0x71, 0xd2, 0x8c, 0xbf, 0x70, 0x3f, 0x0d, + 0x14, 0xdc, 0x36, 0x3a, 0xaa, 0xed, 0x70, 0x72, 0x9c, 0x10, 0x7b, 0xbb, 0x6a, ], fp: [ - 0x48, 0xc1, 0x83, 0x75, 0x7b, 0x5d, 0xa6, 0x61, 0x2a, 0x81, 0xb3, 0x0e, 0x40, - 0xb4, 0xac, 0xaa, 0x2d, 0x9e, 0x73, 0x95, 0x12, 0xe1, 0xd2, 0xd0, 0x01, 0x0e, - 0x92, 0xa7, 0xf7, 0xf2, 0xfc, 0xdf, - ], - d0: Some([ - 0xe8, 0xd0, 0x37, 0x93, 0xcd, 0xd2, 0xba, 0xcc, 0x9c, 0x70, 0x41, - ]), - d1: Some([ - 0x02, 0x0a, 0x7a, 0x6b, 0x0b, 0xf8, 0x4d, 0x3e, 0x89, 0x9f, 0x68, - ]), - d2: None, - dmax: None, - internal_nsk: None, - internal_ovk: [ - 0xdd, 0xba, 0xc2, 0xa4, 0x93, 0xf5, 0x3c, 0x3b, 0x09, 0x33, 0xd9, 0x13, 0xde, - 0xf8, 0x88, 0x48, 0x65, 0x4c, 0x08, 0x7c, 0x12, 0x60, 0x9d, 0xf0, 0x1b, 0xaf, - 0x94, 0x05, 0xce, 0x78, 0x04, 0xfd, - ], - internal_dk: [ - 0x60, 0x2c, 0xd3, 0x17, 0xb7, 0xce, 0xa1, 0x1e, 0x8c, 0xc7, 0xae, 0x2e, 0xa4, - 0x05, 0xb4, 0x0d, 0x46, 0xb1, 0x59, 0x2a, 0x30, 0xf0, 0xcb, 0x6e, 0x8c, 0x4f, - 0x17, 0xd7, 0xf7, 0xc4, 0x7f, 0xeb, - ], - internal_nk: [ - 0xf9, 0x12, 0x87, 0xc0, 0x6e, 0x30, 0xb6, 0x5e, 0xa1, 0xbd, 0xb7, 0x16, 0xb2, - 0x31, 0xde, 0x67, 0x78, 0xa5, 0xd8, 0x0e, 0xe5, 0xcd, 0x9c, 0x06, 0x0d, 0x1a, - 0xba, 0xca, 0xe0, 0xaa, 0xe2, 0x3b, - ], - internal_ivk: [ - 0x1d, 0x59, 0xea, 0x20, 0x17, 0x88, 0x18, 0x64, 0xd2, 0x4e, 0xad, 0xb5, 0xcf, - 0x34, 0x68, 0xa4, 0x1a, 0x1b, 0x2a, 0xaa, 0x0d, 0x1b, 0x3a, 0x72, 0xc6, 0xda, - 0x9c, 0xe6, 0x50, 0x2a, 0x0a, 0x05, - ], - internal_xsk: None, - internal_xfvk: [ - 0x02, 0xdb, 0x99, 0x9e, 0x07, 0x02, 0x00, 0x00, 0x80, 0x97, 0xce, 0x15, 0xf4, - 0xed, 0x1b, 0x97, 0x39, 0xb0, 0x26, 0x2a, 0x46, 0x3b, 0xcb, 0x3d, 0xc9, 0xb3, - 0xbd, 0x23, 0x23, 0xa9, 0xba, 0xa4, 0x41, 0xca, 0x42, 0x77, 0x73, 0x83, 0xa8, - 0xd4, 0x35, 0xa6, 0xc5, 0x92, 0x5a, 0x0f, 0x85, 0xfa, 0x4f, 0x1e, 0x40, 0x5e, - 0x3a, 0x49, 0x70, 0xd0, 0xc4, 0xa4, 0xb4, 0x81, 0x44, 0x38, 0xf4, 0xe9, 0xd4, - 0x52, 0x0e, 0x20, 0xf7, 0xfd, 0xcf, 0x38, 0x41, 0xf9, 0x12, 0x87, 0xc0, 0x6e, - 0x30, 0xb6, 0x5e, 0xa1, 0xbd, 0xb7, 0x16, 0xb2, 0x31, 0xde, 0x67, 0x78, 0xa5, - 0xd8, 0x0e, 0xe5, 0xcd, 0x9c, 0x06, 0x0d, 0x1a, 0xba, 0xca, 0xe0, 0xaa, 0xe2, - 0x3b, 0xdd, 0xba, 0xc2, 0xa4, 0x93, 0xf5, 0x3c, 0x3b, 0x09, 0x33, 0xd9, 0x13, - 0xde, 0xf8, 0x88, 0x48, 0x65, 0x4c, 0x08, 0x7c, 0x12, 0x60, 0x9d, 0xf0, 0x1b, - 0xaf, 0x94, 0x05, 0xce, 0x78, 0x04, 0xfd, 0x60, 0x2c, 0xd3, 0x17, 0xb7, 0xce, - 0xa1, 0x1e, 0x8c, 0xc7, 0xae, 0x2e, 0xa4, 0x05, 0xb4, 0x0d, 0x46, 0xb1, 0x59, - 0x2a, 0x30, 0xf0, 0xcb, 0x6e, 0x8c, 0x4f, 0x17, 0xd7, 0xf7, 0xc4, 0x7f, 0xeb, - ], - internal_fp: [ - 0x30, 0xfe, 0x0d, 0x61, 0x0f, 0x94, 0x7b, 0x2c, 0x26, 0x0e, 0x7b, 0x29, 0xe7, - 0x9e, 0x5c, 0x2e, 0x7d, 0x3e, 0x14, 0xab, 0xf9, 0x79, 0xf6, 0x40, 0x6d, 0x07, - 0xba, 0xf8, 0xfa, 0xdd, 0xf4, 0x95, - ], - }, - TestVector { - ask: None, - nsk: None, - ovk: [ - 0x69, 0xb9, 0xe0, 0xfa, 0x1c, 0x4b, 0x3d, 0xeb, 0x91, 0xd5, 0x3b, 0xee, 0xe8, - 0x71, 0x15, 0x61, 0x21, 0x47, 0x4b, 0x8b, 0x62, 0xef, 0x24, 0x13, 0x44, 0x78, - 0xdc, 0x34, 0x99, 0x69, 0x1a, 0xf6, - ], - dk: [ - 0xbe, 0xcb, 0x50, 0xc3, 0x63, 0xbb, 0x2e, 0xd9, 0xda, 0x5c, 0x30, 0x43, 0xce, - 0xb0, 0xf1, 0xa0, 0x52, 0x7b, 0xf8, 0x36, 0xb2, 0x9a, 0x35, 0xf7, 0xc0, 0xc9, - 0xf2, 0x61, 0x12, 0x3b, 0xe5, 0x6e, - ], - c: [ - 0x8d, 0x93, 0x7b, 0xcf, 0x81, 0xba, 0x43, 0x0d, 0x5b, 0x49, 0xaf, 0xc0, 0xa4, - 0x03, 0x36, 0x7b, 0x1f, 0xd9, 0x98, 0x79, 0xec, 0xba, 0x41, 0xbe, 0x05, 0x1c, - 0x5a, 0x4a, 0xa7, 0xd6, 0xe7, 0xe8, - ], - ak: [ - 0xb1, 0x85, 0xc5, 0x7b, 0x50, 0x9c, 0x25, 0x36, 0xc4, 0xf2, 0xd3, 0x26, 0xd7, - 0x66, 0xc8, 0xfa, 0xb2, 0x54, 0x47, 0xde, 0x53, 0x75, 0xa9, 0x32, 0x8d, 0x64, - 0x9d, 0xda, 0xbd, 0x97, 0xa6, 0xa3, - ], - nk: [ - 0xdb, 0x88, 0x04, 0x9e, 0x02, 0xd2, 0x07, 0x56, 0x8a, 0xfc, 0x42, 0xe0, 0x7d, - 0xb2, 0xab, 0xed, 0x50, 0x0b, 0x27, 0x01, 0xc0, 0x1b, 0xbf, 0xf3, 0x63, 0x99, - 0x76, 0x4b, 0x81, 0xc0, 0x66, 0x4f, - ], - ivk: [ - 0xb0, 0xa5, 0xf3, 0x37, 0x23, 0x2f, 0x2c, 0x3d, 0xac, 0x70, 0xc2, 0xa4, 0x10, - 0xfa, 0x56, 0x1f, 0xc4, 0x5d, 0x8c, 0xc5, 0x9c, 0xda, 0x24, 0x6d, 0x31, 0xc8, - 0xb1, 0x71, 0x5a, 0x57, 0xd9, 0x00, - ], - xsk: None, - xfvk: [ - 0x03, 0x48, 0xc1, 0x83, 0x75, 0x03, 0x00, 0x00, 0x00, 0x8d, 0x93, 0x7b, 0xcf, - 0x81, 0xba, 0x43, 0x0d, 0x5b, 0x49, 0xaf, 0xc0, 0xa4, 0x03, 0x36, 0x7b, 0x1f, - 0xd9, 0x98, 0x79, 0xec, 0xba, 0x41, 0xbe, 0x05, 0x1c, 0x5a, 0x4a, 0xa7, 0xd6, - 0xe7, 0xe8, 0xb1, 0x85, 0xc5, 0x7b, 0x50, 0x9c, 0x25, 0x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 0x69, 0xde, 0x22, 0xc8, ], d0: None, - d1: Some([ - 0x03, 0x0f, 0xfb, 0x26, 0x3a, 0x93, 0x9e, 0x23, 0x0e, 0x96, 0xdd, - ]), - d2: Some([ - 0x7b, 0xbf, 0x63, 0x93, 0x4c, 0x7e, 0x92, 0x67, 0x0c, 0xdb, 0x55, - ]), + d1: None, + d2: None, dmax: Some([ - 0x1a, 0x73, 0x0f, 0xeb, 0x00, 0x59, 0xcf, 0x1f, 0x5b, 0xde, 0xa8, + 0xb8, 0x31, 0xc2, 0x96, 0x5a, 0x86, 0x0a, 0xd7, 0x60, 0xec, 0x2a, + ]), + internal_nsk: Some([ + 0x9c, 0x39, 0x3c, 0x5b, 0xd7, 0x66, 0x4d, 0x63, 0xef, 0xa1, 0xba, 0xea, 0x99, + 0xfc, 0x6d, 0xc4, 0x74, 0xfe, 0xa7, 0x53, 0xce, 0x84, 0xc8, 0x81, 0xd9, 0xef, + 0x28, 0x77, 0x86, 0x75, 0xb1, 0x05, ]), - internal_nsk: None, internal_ovk: [ - 0xbf, 0x19, 0xe2, 0x57, 0xdd, 0x83, 0x3e, 0x02, 0x94, 0xec, 0x2a, 0xcb, 0xdf, - 0xa4, 0x0e, 0x14, 0x52, 0xf8, 0xe6, 0xa1, 0xf0, 0xc7, 0xf6, 0xf3, 0xab, 0xe5, - 0x6a, 0xfd, 0x5f, 0x6e, 0x26, 0x18, + 0x69, 0xaa, 0xb0, 0x2e, 0xa6, 0x43, 0x57, 0x9d, 0x4d, 0x85, 0x2a, 0xf8, 0xb4, + 0x32, 0xb8, 0x8d, 0x1c, 0xa0, 0x00, 0x44, 0x4a, 0xb0, 0x73, 0x7a, 0x41, 0x15, + 0xe0, 0x63, 0xf1, 0x48, 0xd2, 0x72, ], internal_dk: [ - 0x1f, 0xfd, 0x6f, 0x81, 0xfe, 0x85, 0xc4, 0x9f, 0xe3, 0xe7, 0x3e, 0xf7, 0x3e, - 0x50, 0x11, 0x38, 0x22, 0xca, 0x62, 0x67, 0x31, 0x2b, 0x7a, 0xce, 0xd0, 0xc1, - 0x56, 0xa3, 0x2b, 0x3f, 0x24, 0x38, + 0x88, 0x26, 0xa9, 0x3c, 0x65, 0xc6, 0x6e, 0x75, 0x54, 0x32, 0x74, 0xe6, 0x72, + 0xad, 0xf5, 0x59, 0xf7, 0xd7, 0x26, 0x5e, 0x99, 0xcc, 0x11, 0xda, 0x4a, 0x14, + 0x20, 0xa3, 0x7b, 0x92, 0xf7, 0xab, ], internal_nk: [ - 0x82, 0x2f, 0x2f, 0x70, 0x96, 0x0f, 0x05, 0xd6, 0x96, 0x74, 0x58, 0xe3, 0x92, - 0x10, 0xd5, 0x77, 0x1f, 0x98, 0x47, 0xae, 0xf9, 0xe3, 0x4d, 0x94, 0xb8, 0xaf, - 0xbf, 0x95, 0xbb, 0xc4, 0xd2, 0x27, + 0x59, 0xba, 0xa9, 0x0f, 0x83, 0x4a, 0x66, 0x1b, 0xf2, 0xbe, 0x42, 0x46, 0xa4, + 0x3d, 0x18, 0x9c, 0x7d, 0x0e, 0x17, 0xa8, 0x24, 0x7b, 0x4f, 0xd9, 0xd2, 0xe1, + 0x53, 0xa5, 0x97, 0x3d, 0xc8, 0xec, ], internal_ivk: [ - 0xf9, 0x8a, 0x76, 0x09, 0x8e, 0x91, 0x05, 0x03, 0xe8, 0x02, 0x77, 0x52, 0x04, - 0x2d, 0xe8, 0x7e, 0x7d, 0x89, 0x3a, 0xb0, 0x14, 0x5e, 0xbc, 0x3b, 0x05, 0x97, - 0xc2, 0x39, 0x7f, 0x69, 0xd2, 0x01, + 0x8a, 0x86, 0xfb, 0x27, 0x81, 0xfe, 0x6f, 0x24, 0xd9, 0x60, 0xdd, 0xdb, 0x2f, + 0x78, 0x13, 0xc0, 0x31, 0xfe, 0xc5, 0x5d, 0x26, 0xcc, 0xde, 0xe1, 0xf7, 0x18, + 0x2a, 0x3e, 0xc6, 0x83, 0xcf, 0x04, ], - internal_xsk: None, + internal_xsk: Some([ + 0x03, 0x0b, 0xdc, 0x2d, 0x2b, 0x03, 0x00, 0x00, 0x80, 0x33, 0xdc, 0x01, 0x2d, + 0x76, 0x90, 0xce, 0xd2, 0xcd, 0x2b, 0xcb, 0x2c, 0xc3, 0xe4, 0x63, 0xe2, 0x8d, + 0x8c, 0x29, 0xef, 0x3b, 0x01, 0xbe, 0x59, 0xb2, 0xbd, 0xfc, 0x38, 0x5b, 0xbd, + 0xc7, 0x4b, 0x45, 0x93, 0xd2, 0x4d, 0x21, 0xe3, 0x59, 0x37, 0xf1, 0x52, 0xcf, + 0x90, 0x46, 0x1c, 0x33, 0x2f, 0x69, 0x50, 0x3c, 0x10, 0x45, 0x81, 0xd6, 0x83, + 0xe0, 0xac, 0x29, 0xf8, 0x4d, 0xec, 0xaf, 0x07, 0x9c, 0x39, 0x3c, 0x5b, 0xd7, + 0x66, 0x4d, 0x63, 0xef, 0xa1, 0xba, 0xea, 0x99, 0xfc, 0x6d, 0xc4, 0x74, 0xfe, + 0xa7, 0x53, 0xce, 0x84, 0xc8, 0x81, 0xd9, 0xef, 0x28, 0x77, 0x86, 0x75, 0xb1, + 0x05, 0x69, 0xaa, 0xb0, 0x2e, 0xa6, 0x43, 0x57, 0x9d, 0x4d, 0x85, 0x2a, 0xf8, + 0xb4, 0x32, 0xb8, 0x8d, 0x1c, 0xa0, 0x00, 0x44, 0x4a, 0xb0, 0x73, 0x7a, 0x41, + 0x15, 0xe0, 0x63, 0xf1, 0x48, 0xd2, 0x72, 0x88, 0x26, 0xa9, 0x3c, 0x65, 0xc6, + 0x6e, 0x75, 0x54, 0x32, 0x74, 0xe6, 0x72, 0xad, 0xf5, 0x59, 0xf7, 0xd7, 0x26, + 0x5e, 0x99, 0xcc, 0x11, 0xda, 0x4a, 0x14, 0x20, 0xa3, 0x7b, 0x92, 0xf7, 0xab, + ]), internal_xfvk: [ - 0x03, 0x48, 0xc1, 0x83, 0x75, 0x03, 0x00, 0x00, 0x00, 0x8d, 0x93, 0x7b, 0xcf, - 0x81, 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43, 0x72, 0x04, 0xf7, 0x01, 0x2a, 0x3a, 0x1d, + 0x36, 0x58, 0x1d, 0xab, 0x39, 0x7a, 0x84, 0x3b, 0x2c, 0x58, 0x98, 0x11, 0xed, + 0xcc, 0x5b, 0x50, 0x1c, 0xd4, 0xeb, ], }, ]; @@ -1702,26 +1591,24 @@ mod tests { 24, 25, 26, 27, 28, 29, 30, 31, ]; - let i1 = ChildIndex::NonHardened(1); - let i2h = ChildIndex::Hardened(2); - let i3 = ChildIndex::NonHardened(3); + let i1h = ChildIndex::hardened(1); + let i2h = ChildIndex::hardened(2); + let i3h = ChildIndex::hardened(3); let m = ExtendedSpendingKey::master(&seed); - let m_1 = m.derive_child(i1); - let m_1_2h = ExtendedSpendingKey::from_path(&m, &[i1, i2h]); - let m_1_2hv = m_1_2h.to_extended_full_viewing_key(); - let m_1_2hv_3 = m_1_2hv.derive_child(i3).unwrap(); + let m_1h = m.derive_child(i1h); + let m_1h_2h = ExtendedSpendingKey::from_path(&m, &[i1h, i2h]); + let m_1h_2h_3h = m_1h_2h.derive_child(i3h); let xfvks = [ m.to_extended_full_viewing_key(), - m_1.to_extended_full_viewing_key(), - m_1_2h.to_extended_full_viewing_key(), - m_1_2hv, // Appears twice so we can de-duplicate test code below - m_1_2hv_3, + m_1h.to_extended_full_viewing_key(), + m_1h_2h.to_extended_full_viewing_key(), + m_1h_2h_3h.to_extended_full_viewing_key(), ]; assert_eq!(test_vectors.len(), xfvks.len()); - let xsks = [m, m_1, m_1_2h]; + let xsks = [m, m_1h, m_1h_2h, m_1h_2h_3h]; for (xsk, tv) in xsks.iter().zip(test_vectors.iter()) { assert_eq!(xsk.expsk.ask.to_repr().as_ref(), tv.ask.unwrap()); @@ -1729,7 +1616,7 @@ mod tests { assert_eq!(xsk.expsk.ovk.0, tv.ovk); assert_eq!(xsk.dk.0, tv.dk); - assert_eq!(xsk.chain_code.0, tv.c); + assert_eq!(xsk.chain_code.as_bytes(), &tv.c); let mut ser = vec![]; xsk.write(&mut ser).unwrap(); @@ -1744,7 +1631,7 @@ mod tests { assert_eq!(internal_xsk.expsk.ovk.0, tv.internal_ovk); assert_eq!(internal_xsk.dk.0, tv.internal_dk); - assert_eq!(internal_xsk.chain_code.0, tv.c); + assert_eq!(internal_xsk.chain_code.as_bytes(), &tv.c); let mut ser = vec![]; internal_xsk.write(&mut ser).unwrap(); @@ -1757,7 +1644,7 @@ mod tests { assert_eq!(xfvk.fvk.ovk.0, tv.ovk); assert_eq!(xfvk.dk.0, tv.dk); - assert_eq!(xfvk.chain_code.0, tv.c); + assert_eq!(xfvk.chain_code.as_bytes(), &tv.c); assert_eq!(xfvk.fvk.vk.ivk().to_repr().as_ref(), tv.ivk); @@ -1801,7 +1688,7 @@ mod tests { assert_eq!(internal_xfvk.fvk.ovk.0, tv.internal_ovk); assert_eq!(internal_xfvk.dk.0, tv.internal_dk); - assert_eq!(internal_xfvk.chain_code.0, tv.c); + assert_eq!(internal_xfvk.chain_code.as_bytes(), &tv.c); assert_eq!( internal_xfvk.fvk.vk.ivk().to_repr().as_ref(), diff --git a/zcash_primitives/src/zip32.rs b/zcash_primitives/src/zip32.rs index 8e60ac629..2bb2c35d0 100644 --- a/zcash_primitives/src/zip32.rs +++ b/zcash_primitives/src/zip32.rs @@ -5,12 +5,10 @@ use memuse::{self, DynamicUsage}; use subtle::{Choice, ConditionallySelectable}; -use crate::sapling::{Diversifier, NullifierDerivingKey, PaymentAddress, ViewingKey}; pub mod fingerprint; -pub mod sapling; #[deprecated(note = "Please use the types exported from the `zip32::sapling` module instead.")] -pub use sapling::{ +pub use crate::sapling::zip32::{ sapling_address, sapling_default_address, sapling_derive_internal_fvk, sapling_find_address, DiversifiableFullViewingKey, ExtendedFullViewingKey, ExtendedSpendingKey, ZIP32_SAPLING_FVFP_PERSONALIZATION, ZIP32_SAPLING_INT_PERSONALIZATION, @@ -35,6 +33,13 @@ impl From for u32 { } } +impl From for ChildIndex { + fn from(id: AccountId) -> Self { + // Account IDs are always hardened in derivation paths. + ChildIndex::hardened(id.0) + } +} + impl ConditionallySelectable for AccountId { fn conditional_select(a0: &Self, a1: &Self, c: Choice) -> Self { AccountId(u32::conditional_select(&a0.0, &a1.0, c)) @@ -43,41 +48,54 @@ impl ConditionallySelectable for AccountId { // ZIP 32 structures -/// A child index for a derived key +/// A child index for a derived key. +/// +/// Only hardened derivation is supported. #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum ChildIndex { - NonHardened(u32), - Hardened(u32), // Hardened(n) == n + (1 << 31) == n' in path notation -} +pub struct ChildIndex(u32); impl ChildIndex { - pub fn from_index(i: u32) -> Self { - match i { - n if n >= (1 << 31) => ChildIndex::Hardened(n - (1 << 31)), - n => ChildIndex::NonHardened(n), + /// Parses the given ZIP 32 child index. + /// + /// Returns `None` if the hardened bit is not set. + pub fn from_index(i: u32) -> Option { + if i >= (1 << 31) { + Some(ChildIndex(i)) + } else { + None } } - fn master() -> Self { - ChildIndex::from_index(0) + /// Constructs a hardened `ChildIndex` from the given value. + /// + /// # Panics + /// + /// Panics if `value >= (1 << 31)`. + pub const fn hardened(value: u32) -> Self { + assert!(value < (1 << 31)); + Self(value + (1 << 31)) } - fn value(&self) -> u32 { - match *self { - ChildIndex::Hardened(i) => i + (1 << 31), - ChildIndex::NonHardened(i) => i, - } + /// Returns the index as a 32-bit integer, including the hardened bit. + pub fn index(&self) -> u32 { + self.0 } } -/// A BIP-32 chain code +/// A value that is needed, in addition to a spending key, in order to derive descendant +/// keys and addresses of that key. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct ChainCode([u8; 32]); impl ChainCode { - /// Returns byte representation of the chain code, as required for + /// Constructs a `ChainCode` from the given array. + pub fn new(c: [u8; 32]) -> Self { + Self(c) + } + + /// Returns the byte representation of the chain code, as required for /// [ZIP 32](https://zips.z.cash/zip-0032) encoding. - fn as_bytes(&self) -> &[u8; 32] { + pub fn as_bytes(&self) -> &[u8; 32] { &self.0 } }