Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ blake2b_simd = "1"
ff = "0.12"
fpe = "0.5"
group = { version = "0.12.1", features = ["wnaf-memuse"] }
halo2_gadgets = "0.2"
halo2_proofs = "0.2"
halo2_gadgets = {git = "https://github.com/QED-it/halo2", branch = "commit_doamin_from_two_personalizations"}
halo2_proofs = {git = "https://github.com/QED-it/halo2", branch = "commit_doamin_from_two_personalizations"}
hex = "0.4"
lazy_static = "1"
memuse = { version = "0.2.1", features = ["nonempty"] }
Expand All @@ -52,7 +52,7 @@ plotters = { version = "0.3.0", optional = true }

[dev-dependencies]
criterion = "0.3"
halo2_gadgets = { version = "0.2", features = ["test-dependencies"] }
halo2_gadgets = { git = "https://github.com/QED-it/halo2", branch = "commit_doamin_from_two_personalizations", features = ["test-dependencies"] }
hex = "0.4"
proptest = "1.0.0"
zcash_note_encryption = { version = "0.2", features = ["pre-zip-212"] }
Expand Down
5 changes: 4 additions & 1 deletion src/note/commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ impl NoteCommitment {
bits: impl Iterator<Item = bool>,
rcm: NoteCommitTrapdoor,
) -> CtOption<Self> {
let domain = sinsemilla::CommitDomain::new(personalization);
let domain = sinsemilla::CommitDomain::new_with_two_personalizations(
personalization,
NOTE_COMMITMENT_PERSONALIZATION,
);
domain.commit(bits, &rcm.0).map(NoteCommitment)
}
}
Expand Down
63 changes: 31 additions & 32 deletions src/test_vectors/keys.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Test vectors for Orchard key components.
// From https://github.com/zcash-hackworks/zcash-test-vectors/ (orchard_key_components)

pub(crate) struct TestVector {
pub(crate) sk: [u8; 32],
Expand Down Expand Up @@ -26,7 +26,6 @@ pub(crate) struct TestVector {
}

pub(crate) fn test_vectors() -> Vec<TestVector> {
// From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/orchard_key_components.py
vec![
TestVector {
sk: [
Expand Down Expand Up @@ -654,14 +653,14 @@ pub(crate) fn test_vectors() -> Vec<TestVector> {
0xcd, 0x08, 0xcb, 0x05,
],
note_cmx: [
0x71, 0x99, 0x1e, 0xeb, 0x4b, 0x51, 0x7e, 0xd9, 0xd4, 0x31, 0xdc, 0xa9, 0xa2, 0xbb,
0xcf, 0x1c, 0xe8, 0x75, 0xe8, 0x55, 0xdf, 0xf4, 0x8c, 0x69, 0xf4, 0xef, 0x51, 0x01,
0x1e, 0x86, 0x1e, 0x07,
0xf1, 0x34, 0x33, 0x5c, 0x60, 0xf3, 0x17, 0xec, 0x48, 0xd6, 0x7b, 0x49, 0x34, 0x58,
0xde, 0x26, 0xb4, 0x06, 0xfd, 0xd2, 0x10, 0xf8, 0x60, 0xb1, 0x81, 0xaf, 0x7b, 0x82,
0xcd, 0xe9, 0x4e, 0x37,
],
note_nf: [
0xdf, 0x79, 0xd4, 0xa4, 0x6e, 0xca, 0xfd, 0x34, 0x50, 0x9d, 0x41, 0xfc, 0xfb, 0x61,
0x3e, 0x1f, 0xdc, 0xbc, 0x0d, 0x3b, 0xa0, 0xaa, 0x8d, 0xe5, 0x04, 0xd6, 0xf2, 0x54,
0xcd, 0x55, 0x12, 0x32,
0x75, 0x6c, 0x1f, 0x4b, 0xfa, 0xae, 0xc5, 0x5b, 0x42, 0x0a, 0x4f, 0x88, 0x12, 0xdb,
0x6c, 0x43, 0x2e, 0x48, 0x61, 0x6f, 0xb8, 0xd1, 0xbb, 0x2b, 0x1d, 0xd1, 0xe7, 0x2c,
0x0a, 0xa3, 0xdb, 0x3a,
],
},
TestVector {
Expand Down Expand Up @@ -760,14 +759,14 @@ pub(crate) fn test_vectors() -> Vec<TestVector> {
0xa0, 0xd4, 0x70, 0x19,
],
note_cmx: [
0x94, 0x81, 0xcb, 0xac, 0x4e, 0xb0, 0xc0, 0x8d, 0x12, 0x83, 0x47, 0x13, 0xb5, 0x15,
0xfd, 0x8c, 0x61, 0x0d, 0x44, 0xc1, 0x29, 0x50, 0x97, 0xcc, 0x20, 0x13, 0x4d, 0xe2,
0x1c, 0x63, 0x6c, 0x29,
0x07, 0x1c, 0x49, 0x8b, 0x02, 0x6b, 0x8b, 0x1a, 0x7a, 0x1e, 0x84, 0x00, 0x13, 0x87,
0x20, 0x82, 0x3d, 0x80, 0xec, 0xa4, 0x99, 0xac, 0xd2, 0x91, 0xfc, 0x07, 0xfd, 0x2f,
0x41, 0x6e, 0x83, 0x38,
],
note_nf: [
0x44, 0xc8, 0x8d, 0x03, 0x10, 0x21, 0x56, 0x11, 0x25, 0x6a, 0xad, 0x07, 0x34, 0x99,
0x43, 0x08, 0x94, 0x59, 0x73, 0x17, 0x15, 0x75, 0xae, 0x7e, 0x89, 0xf5, 0x8d, 0x44,
0xde, 0xa2, 0x67, 0x10,
0x22, 0x55, 0x5e, 0xe7, 0x85, 0x46, 0x8c, 0xc7, 0x70, 0xca, 0xf9, 0x0f, 0x82, 0x61,
0x1b, 0x80, 0x15, 0xb0, 0x3d, 0xd8, 0x85, 0x6c, 0xc9, 0xa2, 0x7c, 0xbf, 0x7f, 0x5c,
0x31, 0x3d, 0x96, 0x0e,
],
},
TestVector {
Expand Down Expand Up @@ -866,14 +865,14 @@ pub(crate) fn test_vectors() -> Vec<TestVector> {
0xe5, 0xe1, 0x71, 0x1c,
],
note_cmx: [
0xfe, 0x09, 0xf5, 0x89, 0x7c, 0xed, 0xc7, 0x67, 0x7c, 0xf5, 0x80, 0xc5, 0xf0, 0xd1,
0x83, 0xed, 0x3b, 0xc0, 0x94, 0x5c, 0xb1, 0xc3, 0x85, 0xf3, 0x88, 0xf9, 0x3f, 0x94,
0x3e, 0xff, 0x2a, 0x2f,
0x7b, 0xc1, 0xdd, 0xba, 0x52, 0x06, 0x14, 0xdd, 0x4e, 0x44, 0x3e, 0xaa, 0xf2, 0x5b,
0xea, 0xa0, 0x14, 0xc2, 0x78, 0x6d, 0x15, 0x0a, 0x3b, 0x6f, 0xea, 0x97, 0x6a, 0x9b,
0xdf, 0x27, 0x02, 0x04,
],
note_nf: [
0x80, 0xdf, 0x21, 0xbf, 0xeb, 0x46, 0x06, 0x16, 0x06, 0x29, 0x61, 0x03, 0x86, 0xc7,
0x99, 0x02, 0xef, 0x49, 0x8b, 0x61, 0xb1, 0x55, 0x0c, 0xbd, 0x10, 0x55, 0xf8, 0x26,
0x94, 0xfa, 0x5b, 0x03,
0x78, 0x31, 0xe9, 0xc5, 0x1c, 0xc1, 0xdc, 0xa6, 0xda, 0x89, 0x1a, 0xde, 0xad, 0x3a,
0x79, 0x24, 0xff, 0x26, 0x4b, 0xe4, 0x25, 0x0b, 0xec, 0x05, 0xc5, 0x92, 0xd3, 0x14,
0x52, 0x6b, 0x1a, 0x2f,
],
},
TestVector {
Expand Down Expand Up @@ -972,14 +971,14 @@ pub(crate) fn test_vectors() -> Vec<TestVector> {
0xcd, 0xdb, 0x41, 0x87,
],
note_cmx: [
0x5e, 0x54, 0xfe, 0x7e, 0x59, 0x52, 0xa6, 0xea, 0x26, 0xba, 0xbc, 0x32, 0xcf, 0xed,
0xf5, 0xe6, 0x0b, 0x56, 0x82, 0x58, 0x98, 0x0d, 0x92, 0xc1, 0xe5, 0xdd, 0x3f, 0xdf,
0x3e, 0x48, 0x7e, 0x1d,
0xea, 0xf9, 0x49, 0x1c, 0xab, 0xca, 0x20, 0x07, 0xba, 0x91, 0xea, 0xc9, 0xb3, 0xc0,
0xa1, 0x1c, 0x58, 0xef, 0x5f, 0xe0, 0x71, 0x86, 0x8c, 0x66, 0xf1, 0xc5, 0xf5, 0x9c,
0x7c, 0x99, 0x25, 0x14,
],
note_nf: [
0x45, 0x5f, 0xd0, 0xe5, 0x2e, 0x59, 0x33, 0x62, 0x57, 0x2d, 0x12, 0xdb, 0x44, 0xbb,
0xf0, 0xe0, 0x95, 0x8a, 0xf9, 0xd5, 0x8f, 0xbd, 0xf9, 0x7b, 0x85, 0x22, 0x8e, 0xca,
0xd0, 0xde, 0x7f, 0x05,
0x3a, 0xbc, 0x17, 0xad, 0xee, 0x2a, 0xa8, 0x8d, 0xf8, 0x93, 0x99, 0x4f, 0x1a, 0xf2,
0x71, 0x51, 0xc1, 0x8b, 0xa6, 0xa9, 0x89, 0xc4, 0xbf, 0xfb, 0xb9, 0xa9, 0x18, 0xd5,
0x50, 0x71, 0x95, 0x02,
],
},
TestVector {
Expand Down Expand Up @@ -1078,14 +1077,14 @@ pub(crate) fn test_vectors() -> Vec<TestVector> {
0xca, 0x26, 0xfa, 0xc4,
],
note_cmx: [
0xdf, 0x1e, 0x28, 0x2c, 0x9b, 0xf3, 0x09, 0x72, 0xb2, 0x8c, 0x46, 0xed, 0x8a, 0x54,
0x42, 0x6d, 0xae, 0xc1, 0xae, 0x38, 0x1a, 0x38, 0x5d, 0xf2, 0x5f, 0xff, 0xfa, 0x66,
0x79, 0x53, 0xd3, 0x33,
0x22, 0x0c, 0xf6, 0xb7, 0xbd, 0x7d, 0xf1, 0x1a, 0xeb, 0x46, 0xb8, 0xf6, 0x52, 0x19,
0x71, 0xe4, 0xf5, 0xce, 0xc6, 0x0e, 0x2c, 0x3a, 0xd1, 0x9e, 0x3b, 0x3f, 0x40, 0x7e,
0x69, 0x4b, 0xe8, 0x01,
],
note_nf: [
0x97, 0x0a, 0xff, 0xd7, 0xf1, 0x0d, 0x5b, 0x71, 0x23, 0x27, 0xe8, 0x39, 0x7e, 0x51,
0x45, 0x3f, 0x85, 0xf4, 0xc2, 0x0f, 0x80, 0x1e, 0x97, 0xe5, 0xe6, 0x40, 0x0e, 0xb0,
0xed, 0xc4, 0xbb, 0x03,
0x0d, 0x35, 0x9b, 0x02, 0xf6, 0x2d, 0x72, 0x18, 0xc8, 0x93, 0xd0, 0x4e, 0xc0, 0xed,
0xd4, 0x89, 0xb2, 0x33, 0xa3, 0xc6, 0x60, 0x15, 0xaf, 0x93, 0x93, 0x0b, 0x23, 0x30,
0x35, 0x82, 0x07, 0x3f,
],
},
]
Expand Down
Loading