Add test vectors for Orchard internal key derivation.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
b10115d363
commit
6c2bac7b73
|
@ -9,6 +9,10 @@
|
|||
dk: [u8; 32],
|
||||
default_d: [u8; 11],
|
||||
default_pk_d: [u8; 32],
|
||||
internal_rivk: [u8; 32],
|
||||
internal_ivk: [u8; 32],
|
||||
internal_ovk: [u8; 32],
|
||||
internal_dk: [u8; 32],
|
||||
note_v: u64,
|
||||
note_rho: [u8; 32],
|
||||
note_rseed: [u8; 32],
|
||||
|
@ -49,6 +53,18 @@
|
|||
default_pk_d: [
|
||||
0x08, 0xdd, 0x8e, 0xbd, 0x7d, 0xe9, 0x2a, 0x68, 0xe5, 0x86, 0xa3, 0x4d, 0xb8, 0xfe, 0xa9, 0x99, 0xef, 0xd2, 0x01, 0x6f, 0xae, 0x76, 0x75, 0x0a, 0xfa, 0xe7, 0xee, 0x94, 0x16, 0x46, 0xbc, 0xb9
|
||||
],
|
||||
internal_rivk: [
|
||||
0x90, 0x1a, 0x30, 0xb9, 0x9a, 0xe1, 0x57, 0x0c, 0xb8, 0x0b, 0xb6, 0x16, 0xae, 0xef, 0x3b, 0xb9, 0x16, 0xc6, 0x40, 0xc4, 0xcc, 0x62, 0x0f, 0x9b, 0x4b, 0x44, 0x99, 0xc7, 0x43, 0x32, 0xeb, 0x2a
|
||||
],
|
||||
internal_ivk: [
|
||||
0x90, 0x6e, 0x2d, 0x20, 0xd0, 0x0d, 0xc0, 0xbf, 0x7c, 0x52, 0x06, 0x87, 0xd9, 0xdf, 0x3c, 0xe9, 0x81, 0x4d, 0x30, 0xee, 0x05, 0xc2, 0x15, 0xf8, 0x76, 0x4a, 0x32, 0xc3, 0x62, 0xf9, 0x26, 0x2f
|
||||
],
|
||||
internal_ovk: [
|
||||
0xd7, 0x26, 0x8b, 0xeb, 0xbe, 0xe6, 0x92, 0x28, 0x62, 0x52, 0xac, 0x60, 0xbd, 0x4d, 0xf4, 0x05, 0xea, 0x49, 0x9d, 0x69, 0x7c, 0x45, 0x47, 0x73, 0xc5, 0xc4, 0x3c, 0xb1, 0x70, 0x93, 0x01, 0x23
|
||||
],
|
||||
internal_dk: [
|
||||
0x6d, 0x61, 0xa0, 0x3f, 0x74, 0x6b, 0xa9, 0x3b, 0x93, 0x24, 0x02, 0xac, 0x10, 0x71, 0xfc, 0x27, 0x59, 0xd4, 0xf4, 0xd6, 0x84, 0xb2, 0xc5, 0x05, 0x6d, 0x5b, 0x17, 0x7a, 0xf0, 0xfa, 0x8a, 0xa9
|
||||
],
|
||||
note_v: 15643327852135767324,
|
||||
note_rho: [
|
||||
0x2c, 0xb5, 0xb4, 0x06, 0xed, 0x89, 0x85, 0xe1, 0x81, 0x30, 0xab, 0x33, 0x36, 0x26, 0x97, 0xb0, 0xe4, 0xe4, 0xc7, 0x63, 0xcc, 0xb8, 0xf6, 0x76, 0x49, 0x5c, 0x22, 0x2f, 0x7f, 0xba, 0x1e, 0x31
|
||||
|
@ -94,6 +110,18 @@
|
|||
default_pk_d: [
|
||||
0x3d, 0x3d, 0xe4, 0xd5, 0x2c, 0x77, 0xfd, 0x0b, 0x63, 0x0a, 0x40, 0xdc, 0x38, 0x21, 0x24, 0x87, 0xb2, 0xff, 0x6e, 0xee, 0xf5, 0x6d, 0x8c, 0x6a, 0x61, 0x63, 0xe8, 0x54, 0xaf, 0xf0, 0x41, 0x89
|
||||
],
|
||||
internal_rivk: [
|
||||
0x8a, 0x22, 0xa7, 0xf5, 0xa1, 0xe9, 0x1a, 0x92, 0xad, 0x39, 0x4b, 0x18, 0xeb, 0x73, 0x38, 0xb5, 0x92, 0x47, 0x0d, 0xd4, 0x2b, 0xe8, 0xef, 0x84, 0xc9, 0x3e, 0x7c, 0xd8, 0x45, 0xec, 0xfa, 0x32
|
||||
],
|
||||
internal_ivk: [
|
||||
0x12, 0x11, 0x83, 0xcb, 0x3b, 0x8d, 0x06, 0xf5, 0x99, 0xbb, 0x38, 0xb3, 0x73, 0x22, 0x85, 0x1e, 0x5f, 0xc9, 0x5a, 0xd0, 0xc9, 0x70, 0x7e, 0xe8, 0x5f, 0xb6, 0x5e, 0x21, 0xf1, 0xa3, 0x0d, 0x13
|
||||
],
|
||||
internal_ovk: [
|
||||
0x93, 0x25, 0x2b, 0x24, 0xb4, 0x91, 0xd9, 0xc9, 0xc9, 0x97, 0x65, 0xc8, 0x4d, 0x4a, 0xc7, 0xc2, 0xbf, 0xf0, 0x54, 0xcd, 0x9c, 0xad, 0xcd, 0x3e, 0x01, 0xb2, 0x6f, 0x21, 0xe2, 0x84, 0x09, 0x09
|
||||
],
|
||||
internal_dk: [
|
||||
0x6e, 0xea, 0x18, 0xfd, 0x0d, 0x50, 0x70, 0x7f, 0x90, 0xdf, 0x00, 0x2c, 0xbf, 0x30, 0x9e, 0xca, 0x3c, 0x00, 0xd3, 0x98, 0xae, 0xde, 0x1f, 0xdc, 0x2a, 0xbf, 0xfc, 0x88, 0x35, 0x38, 0x59, 0xaf
|
||||
],
|
||||
note_v: 4481649511318637270,
|
||||
note_rho: [
|
||||
0xa5, 0x1b, 0x00, 0x52, 0xad, 0x80, 0x84, 0xa8, 0xb9, 0xda, 0x94, 0x8d, 0x32, 0x0d, 0xad, 0xd6, 0x4f, 0x54, 0x31, 0xe6, 0x1d, 0xdf, 0x65, 0x8d, 0x24, 0xae, 0x67, 0xc2, 0x2c, 0x8d, 0x13, 0x09
|
||||
|
@ -139,6 +167,18 @@
|
|||
default_pk_d: [
|
||||
0xec, 0xcb, 0x6a, 0x57, 0x80, 0x20, 0x42, 0x37, 0x98, 0x72, 0x32, 0xbc, 0x09, 0x8f, 0x89, 0xac, 0xc4, 0x75, 0xc3, 0xf7, 0x4b, 0xd6, 0x9e, 0x2f, 0x35, 0xd4, 0x47, 0x36, 0xf4, 0x8f, 0x3c, 0x14
|
||||
],
|
||||
internal_rivk: [
|
||||
0x0a, 0xa9, 0xaa, 0xaa, 0x2c, 0xf1, 0x84, 0x90, 0xdd, 0xf9, 0xa7, 0xe5, 0x21, 0x07, 0x14, 0x07, 0xea, 0x9b, 0xff, 0xfe, 0x84, 0x34, 0x29, 0xbc, 0x94, 0xa2, 0x88, 0xe8, 0xa6, 0x06, 0xa7, 0x10
|
||||
],
|
||||
internal_ivk: [
|
||||
0xa0, 0x6a, 0xbd, 0x29, 0xd5, 0xa1, 0x99, 0xe1, 0xc2, 0x10, 0x25, 0xb0, 0x33, 0x7e, 0x94, 0x1f, 0x6d, 0x4d, 0x84, 0xeb, 0x7c, 0xc3, 0x5a, 0x39, 0x7f, 0x9e, 0x75, 0x3f, 0xda, 0xed, 0x81, 0x0d
|
||||
],
|
||||
internal_ovk: [
|
||||
0xf8, 0x2e, 0xb2, 0x49, 0x06, 0xe2, 0x94, 0xff, 0x65, 0x71, 0xac, 0x7d, 0x83, 0x68, 0xea, 0x82, 0x80, 0xd4, 0x22, 0xf3, 0x47, 0x7c, 0xe7, 0x2a, 0xef, 0x5f, 0x9b, 0x9e, 0xca, 0x48, 0x46, 0x8f
|
||||
],
|
||||
internal_dk: [
|
||||
0x36, 0x56, 0xb5, 0x45, 0xa5, 0x0a, 0x6b, 0x26, 0x28, 0x74, 0x76, 0x64, 0x1b, 0x2b, 0x68, 0xc6, 0x3c, 0x36, 0xf3, 0x32, 0xe7, 0x45, 0x57, 0xe9, 0x16, 0x05, 0x0f, 0x0b, 0x91, 0x11, 0x17, 0x9b
|
||||
],
|
||||
note_v: 14496603531126387959,
|
||||
note_rho: [
|
||||
0x32, 0xb4, 0xf4, 0x73, 0xf4, 0x68, 0xa0, 0x08, 0xe7, 0x23, 0x89, 0xfc, 0x03, 0x88, 0x0d, 0x78, 0x0c, 0xb0, 0x7f, 0xcf, 0xaa, 0xbe, 0x3f, 0x1a, 0x84, 0xb2, 0x7d, 0xb5, 0x9a, 0x4a, 0x15, 0x3d
|
||||
|
@ -184,6 +224,18 @@
|
|||
default_pk_d: [
|
||||
0x04, 0xea, 0x8c, 0x13, 0x20, 0xff, 0xbb, 0xad, 0xfe, 0x96, 0xf0, 0xc6, 0xff, 0x16, 0xb6, 0x07, 0x11, 0x1b, 0x55, 0x83, 0xbf, 0xb6, 0xf1, 0xea, 0x45, 0x27, 0x5e, 0xf2, 0xaa, 0x2d, 0x87, 0x9b
|
||||
],
|
||||
internal_rivk: [
|
||||
0x9e, 0x45, 0x2a, 0xb7, 0x2c, 0x6c, 0x8e, 0xcc, 0xf2, 0xe4, 0x39, 0xa0, 0xce, 0xc0, 0xa0, 0xac, 0x39, 0x4a, 0x1a, 0xa1, 0x21, 0xac, 0x60, 0x32, 0xa7, 0xeb, 0xc2, 0x9d, 0xb4, 0x85, 0x62, 0x26
|
||||
],
|
||||
internal_ivk: [
|
||||
0x3b, 0xa9, 0x3b, 0x0f, 0xc3, 0xf2, 0x7a, 0xb2, 0x17, 0x63, 0x5d, 0x03, 0xf9, 0x0d, 0x0b, 0x84, 0x2d, 0x99, 0xa1, 0x2c, 0xdc, 0x37, 0xa8, 0x1c, 0x18, 0x1e, 0xc0, 0x18, 0xe5, 0xf4, 0x4c, 0x11
|
||||
],
|
||||
internal_ovk: [
|
||||
0xe3, 0xc7, 0xf8, 0x6c, 0x1b, 0x23, 0x83, 0xb3, 0xbd, 0x41, 0xad, 0x1a, 0x8f, 0x11, 0xef, 0xa2, 0x55, 0x4a, 0x41, 0x0a, 0x98, 0xc8, 0x92, 0x07, 0xae, 0xb4, 0x31, 0x9b, 0x1a, 0xbd, 0x78, 0x79
|
||||
],
|
||||
internal_dk: [
|
||||
0xd7, 0x1a, 0x68, 0xcf, 0xd6, 0xc7, 0x68, 0xf4, 0x30, 0x73, 0xf6, 0x98, 0x18, 0x9a, 0xc7, 0x5e, 0xe4, 0x21, 0xb4, 0x20, 0x4b, 0xb6, 0xf3, 0xc5, 0xd0, 0xfc, 0x43, 0x28, 0x49, 0xaa, 0x71, 0x61
|
||||
],
|
||||
note_v: 6792346249443327211,
|
||||
note_rho: [
|
||||
0x4b, 0x19, 0x22, 0x32, 0xec, 0xb9, 0xf0, 0xc0, 0x24, 0x11, 0xe5, 0x25, 0x96, 0xbc, 0x5e, 0x90, 0x45, 0x7e, 0x74, 0x59, 0x39, 0xff, 0xed, 0xbd, 0x12, 0x86, 0x3c, 0xe7, 0x1a, 0x02, 0xaf, 0x11
|
||||
|
@ -229,6 +281,18 @@
|
|||
default_pk_d: [
|
||||
0xb6, 0x53, 0x3d, 0xcb, 0xff, 0xf0, 0xf6, 0xc1, 0xce, 0xef, 0xa8, 0x47, 0x99, 0xbd, 0xa3, 0xde, 0x73, 0x34, 0x32, 0x6c, 0xcd, 0x65, 0xf7, 0xce, 0x92, 0xff, 0x3d, 0x9e, 0x6e, 0x1f, 0x14, 0x0b
|
||||
],
|
||||
internal_rivk: [
|
||||
0x25, 0x44, 0x06, 0x72, 0x3b, 0x06, 0x67, 0xaf, 0x27, 0xe5, 0x1c, 0xb3, 0xce, 0x8f, 0xa1, 0x38, 0x81, 0x64, 0xd9, 0x43, 0x76, 0xc8, 0x50, 0xbd, 0xdb, 0x39, 0xe9, 0xbe, 0xa5, 0xfa, 0x96, 0x05
|
||||
],
|
||||
internal_ivk: [
|
||||
0xba, 0xd4, 0x83, 0x7b, 0xa7, 0x88, 0x22, 0xb8, 0xb1, 0x65, 0xb0, 0xa1, 0x6e, 0x11, 0x04, 0xc7, 0x05, 0xc3, 0xc0, 0xe3, 0x82, 0xd3, 0xf1, 0x3c, 0x19, 0x5c, 0x0e, 0xf3, 0x11, 0xbb, 0x80, 0x04
|
||||
],
|
||||
internal_ovk: [
|
||||
0xb9, 0x11, 0x3a, 0x95, 0x2d, 0xcc, 0x1e, 0x15, 0xc3, 0x4d, 0x13, 0x66, 0x03, 0xa2, 0xef, 0x25, 0x4a, 0x38, 0x75, 0x5a, 0x55, 0x7f, 0xa9, 0xf8, 0x8c, 0x14, 0x3b, 0xd3, 0x07, 0x64, 0x41, 0xb0
|
||||
],
|
||||
internal_dk: [
|
||||
0x02, 0xb5, 0x2c, 0x6e, 0xd9, 0xad, 0x49, 0xfb, 0x38, 0xe4, 0x44, 0x7c, 0x69, 0xb5, 0x70, 0xeb, 0xd0, 0x55, 0xe4, 0xc7, 0xfd, 0x91, 0xc0, 0x20, 0xff, 0x43, 0x46, 0x1d, 0x14, 0xe0, 0x2f, 0x29
|
||||
],
|
||||
note_v: 4079549063511228677,
|
||||
note_rho: [
|
||||
0x26, 0x70, 0xdc, 0x82, 0xd3, 0x90, 0x26, 0xc6, 0xcb, 0x4c, 0xd4, 0xb0, 0xf7, 0xf5, 0xaa, 0x2a, 0x4f, 0x5a, 0x53, 0x41, 0xec, 0x5d, 0xd7, 0x15, 0x40, 0x6f, 0x2f, 0xdd, 0x2a, 0xfa, 0x73, 0x3f
|
||||
|
@ -274,6 +338,18 @@
|
|||
default_pk_d: [
|
||||
0x3d, 0xa5, 0x27, 0x3a, 0x56, 0x67, 0xc7, 0x66, 0xb8, 0x23, 0x12, 0x06, 0x18, 0x0f, 0x15, 0x8a, 0xc0, 0x2a, 0xf3, 0xf0, 0x6e, 0xcc, 0xa6, 0xec, 0x7c, 0x38, 0xc7, 0x5d, 0x33, 0x60, 0x03, 0x20
|
||||
],
|
||||
internal_rivk: [
|
||||
0x88, 0xd7, 0xb1, 0x96, 0x99, 0xf3, 0x94, 0xa5, 0x50, 0xbc, 0x9c, 0xdc, 0x6b, 0xf3, 0xfc, 0x71, 0xf6, 0x10, 0xc3, 0x06, 0x56, 0x37, 0x61, 0x53, 0xa6, 0x96, 0x1f, 0xcd, 0x5b, 0x97, 0xfa, 0x19
|
||||
],
|
||||
internal_ivk: [
|
||||
0x0a, 0x2d, 0xc9, 0x66, 0x61, 0xb9, 0x27, 0x25, 0x0d, 0x7e, 0x3c, 0xd2, 0xc7, 0xe0, 0x6d, 0x51, 0x74, 0xc6, 0x2c, 0xb1, 0x2e, 0x07, 0x16, 0x7f, 0x19, 0x4f, 0x4c, 0xe6, 0x4e, 0x68, 0x95, 0x02
|
||||
],
|
||||
internal_ovk: [
|
||||
0xcc, 0x79, 0x65, 0xf3, 0x3a, 0xc0, 0x1c, 0x60, 0x68, 0x51, 0xb1, 0x29, 0xbd, 0xc9, 0xb6, 0xab, 0xd5, 0xca, 0x5b, 0x9d, 0x24, 0x1d, 0xbd, 0x5c, 0x18, 0xb2, 0x46, 0x9b, 0x7c, 0x8c, 0xc8, 0x9f
|
||||
],
|
||||
internal_dk: [
|
||||
0xda, 0xa2, 0x42, 0xd2, 0x0d, 0xfd, 0xce, 0x8f, 0xc1, 0x0f, 0x4d, 0x99, 0x39, 0x7d, 0xa2, 0x2c, 0x49, 0x1d, 0xc0, 0x9e, 0x1b, 0x12, 0x0f, 0x66, 0x93, 0xd6, 0x86, 0xec, 0xd4, 0x03, 0x0a, 0x00
|
||||
],
|
||||
note_v: 5706402952489856202,
|
||||
note_rho: [
|
||||
0xa1, 0xdf, 0x0e, 0x5b, 0x87, 0xb5, 0xbe, 0xce, 0x47, 0x7a, 0x70, 0x96, 0x49, 0xe9, 0x50, 0x06, 0x05, 0x91, 0x39, 0x48, 0x12, 0x95, 0x1e, 0x1f, 0xe3, 0x89, 0x5b, 0x8c, 0xc3, 0xd1, 0x4d, 0x2c
|
||||
|
@ -319,6 +395,18 @@
|
|||
default_pk_d: [
|
||||
0xac, 0xdc, 0xd3, 0x48, 0xca, 0x45, 0xee, 0x58, 0x32, 0x78, 0x30, 0x38, 0x46, 0xca, 0x07, 0x84, 0x59, 0xd5, 0xbe, 0x5c, 0x5d, 0xcf, 0x34, 0x7e, 0x3b, 0x9a, 0x34, 0xcb, 0xa1, 0x24, 0xb4, 0xa3
|
||||
],
|
||||
internal_rivk: [
|
||||
0x94, 0x1a, 0x17, 0xe1, 0x20, 0x2a, 0x62, 0x71, 0xa4, 0x4a, 0x01, 0x66, 0x65, 0x53, 0xb5, 0x81, 0xbf, 0x25, 0xef, 0x99, 0xe8, 0xe9, 0x5f, 0x13, 0x2a, 0xce, 0x38, 0x1d, 0x96, 0x01, 0x84, 0x32
|
||||
],
|
||||
internal_ivk: [
|
||||
0xa2, 0x76, 0x29, 0xac, 0x1c, 0x62, 0xc9, 0xf4, 0xda, 0xd5, 0x7c, 0x95, 0x30, 0xab, 0x2a, 0x59, 0x80, 0x0d, 0x2e, 0xf4, 0x55, 0xcd, 0x17, 0x44, 0x6f, 0x3f, 0xc6, 0x08, 0x1a, 0x58, 0x1e, 0x3b
|
||||
],
|
||||
internal_ovk: [
|
||||
0xe9, 0x89, 0x8e, 0xd6, 0xb6, 0x69, 0xc8, 0xd9, 0xd5, 0x90, 0xb7, 0x59, 0xd0, 0x29, 0x5f, 0xcf, 0xaf, 0x95, 0xe2, 0xda, 0xf7, 0xda, 0x99, 0x1c, 0x27, 0x57, 0xdc, 0xef, 0xe1, 0x62, 0x6e, 0x0e
|
||||
],
|
||||
internal_dk: [
|
||||
0x61, 0x0c, 0xbd, 0x9a, 0x57, 0x79, 0x79, 0xe1, 0xf7, 0x1d, 0xa8, 0x10, 0x0f, 0x6f, 0xe6, 0xb8, 0xf6, 0xd1, 0x0a, 0x74, 0x7f, 0xed, 0x2a, 0x1c, 0x91, 0xcb, 0xe1, 0x42, 0x47, 0x5c, 0x30, 0x82
|
||||
],
|
||||
note_v: 2558469029534639129,
|
||||
note_rho: [
|
||||
0x72, 0x2d, 0xb0, 0x41, 0xa3, 0xef, 0x66, 0xfa, 0x48, 0x3a, 0xfd, 0x3c, 0x2e, 0x19, 0xe5, 0x94, 0x44, 0xa6, 0x4a, 0xdd, 0x6d, 0xf1, 0xd9, 0x63, 0xf5, 0xdd, 0x5b, 0x50, 0x10, 0xd3, 0xd0, 0x25
|
||||
|
@ -364,6 +452,18 @@
|
|||
default_pk_d: [
|
||||
0xeb, 0x2c, 0x6f, 0xee, 0x34, 0x1e, 0xad, 0xe0, 0x7d, 0x74, 0x87, 0x99, 0x7a, 0xa7, 0x23, 0x69, 0x7d, 0x05, 0xe6, 0x29, 0x60, 0xdf, 0x37, 0x9c, 0x9e, 0x4a, 0x8d, 0x47, 0x6d, 0xfa, 0xc5, 0xbf
|
||||
],
|
||||
internal_rivk: [
|
||||
0x66, 0x3b, 0x67, 0xd3, 0xac, 0x15, 0x99, 0x27, 0xf0, 0x6e, 0x6c, 0x8d, 0xab, 0x80, 0xa5, 0x89, 0x67, 0xc5, 0x45, 0xda, 0xac, 0x3d, 0x98, 0x72, 0x9a, 0x0b, 0xcc, 0x41, 0xfd, 0x53, 0x6d, 0x2b
|
||||
],
|
||||
internal_ivk: [
|
||||
0xaa, 0x6a, 0xcc, 0x8a, 0x7a, 0xa9, 0xa8, 0x05, 0x20, 0x04, 0xff, 0x93, 0x83, 0x3f, 0x4a, 0xbb, 0x15, 0x3b, 0x45, 0x79, 0x7f, 0xd9, 0x07, 0xe3, 0x05, 0xc8, 0x92, 0x7b, 0xb0, 0x37, 0x82, 0x20
|
||||
],
|
||||
internal_ovk: [
|
||||
0xbf, 0xd1, 0x09, 0x67, 0x27, 0xb6, 0xd5, 0xa2, 0xe1, 0x7a, 0xcb, 0xc5, 0xb2, 0x46, 0x80, 0xcb, 0x88, 0xdb, 0x34, 0xcf, 0x53, 0xb6, 0xb7, 0x46, 0x6c, 0xef, 0x67, 0x6f, 0xb3, 0xf7, 0x22, 0x29
|
||||
],
|
||||
internal_dk: [
|
||||
0x47, 0xbd, 0xf9, 0x27, 0x1e, 0xcc, 0x50, 0xe7, 0x05, 0xc5, 0x21, 0xcd, 0x0d, 0xbb, 0xaf, 0x1c, 0x4e, 0x6a, 0x96, 0x2f, 0xc9, 0x14, 0x13, 0x48, 0xb8, 0xbd, 0x7b, 0x35, 0xc4, 0x00, 0x1e, 0x62
|
||||
],
|
||||
note_v: 15425828902564319772,
|
||||
note_rho: [
|
||||
0x73, 0x6c, 0x23, 0x35, 0x7c, 0x85, 0xf4, 0x57, 0x91, 0xe1, 0x70, 0x80, 0x29, 0xd9, 0x82, 0x4d, 0x90, 0x70, 0x46, 0x07, 0xf3, 0x87, 0xa0, 0x3e, 0x49, 0xbf, 0x98, 0x36, 0x57, 0x44, 0x31, 0x34
|
||||
|
@ -409,6 +509,18 @@
|
|||
default_pk_d: [
|
||||
0x26, 0x8c, 0xc2, 0x4b, 0x38, 0xa6, 0x28, 0x80, 0xb6, 0xee, 0x3c, 0xbc, 0xb8, 0x5a, 0x71, 0x2f, 0xa6, 0x86, 0xcf, 0xfc, 0xa6, 0xdb, 0x2f, 0xee, 0xc5, 0xf3, 0xc3, 0x56, 0x6f, 0x84, 0x21, 0x8f
|
||||
],
|
||||
internal_rivk: [
|
||||
0x00, 0x57, 0x37, 0x74, 0x61, 0xf2, 0x19, 0x1a, 0x7e, 0xca, 0x2b, 0x02, 0xed, 0xfd, 0x9c, 0x9b, 0x44, 0x84, 0x5d, 0x2f, 0xdb, 0x8a, 0x99, 0xc7, 0x61, 0x20, 0x52, 0x7e, 0x53, 0xdd, 0x09, 0x17
|
||||
],
|
||||
internal_ivk: [
|
||||
0x81, 0x62, 0x97, 0x35, 0x09, 0x47, 0x0c, 0x44, 0x24, 0x19, 0x11, 0xc0, 0x6d, 0x04, 0x02, 0x9f, 0x5f, 0x1f, 0x0e, 0x98, 0x51, 0xe3, 0x2b, 0xa6, 0x9b, 0x18, 0xe5, 0x81, 0x05, 0xdd, 0x4e, 0x2b
|
||||
],
|
||||
internal_ovk: [
|
||||
0x69, 0x47, 0x91, 0x0e, 0xa3, 0xe7, 0x33, 0x1d, 0x15, 0xa7, 0x1a, 0x64, 0xb2, 0xa8, 0xc1, 0x6a, 0x6d, 0xa0, 0x8e, 0x6f, 0x34, 0x29, 0xdb, 0x26, 0xf9, 0x37, 0xab, 0x9d, 0xd1, 0x33, 0xb5, 0xfd
|
||||
],
|
||||
internal_dk: [
|
||||
0x32, 0x7f, 0x76, 0xcc, 0x42, 0x44, 0xce, 0x0a, 0x91, 0x48, 0xa3, 0x5a, 0x7e, 0xa6, 0x22, 0x8d, 0x44, 0x1c, 0x4c, 0x7b, 0x05, 0xbd, 0x02, 0x65, 0x7c, 0xea, 0xab, 0xb6, 0x09, 0xbc, 0x3c, 0x52
|
||||
],
|
||||
note_v: 12606128263924155660,
|
||||
note_rho: [
|
||||
0x12, 0xf6, 0xb0, 0x2f, 0xe8, 0x06, 0xb9, 0x45, 0x69, 0xcd, 0x40, 0x59, 0xf3, 0x96, 0xbf, 0x29, 0xb9, 0x9d, 0x0a, 0x40, 0xe5, 0xe1, 0x71, 0x1c, 0xa9, 0x44, 0xf7, 0x2d, 0x43, 0x6a, 0x10, 0x2f
|
||||
|
@ -454,6 +566,18 @@
|
|||
default_pk_d: [
|
||||
0xf5, 0x17, 0x17, 0x4b, 0xe2, 0x58, 0x92, 0x32, 0x78, 0xcf, 0x45, 0x89, 0x08, 0xc0, 0x73, 0x56, 0x49, 0xf1, 0x89, 0x9d, 0xb9, 0x9c, 0x3b, 0xa9, 0x00, 0x3f, 0x4b, 0xa3, 0x0a, 0xb0, 0xd2, 0x10
|
||||
],
|
||||
internal_rivk: [
|
||||
0xd8, 0x09, 0xa2, 0xa3, 0xd3, 0x6e, 0xf9, 0x6d, 0xc5, 0x63, 0xf8, 0xa7, 0xb4, 0x13, 0x90, 0x8b, 0xfd, 0xff, 0xc0, 0x6d, 0x51, 0x06, 0x48, 0x49, 0xef, 0x88, 0x6b, 0x6a, 0x1d, 0x1d, 0x7c, 0x3f
|
||||
],
|
||||
internal_ivk: [
|
||||
0xae, 0x18, 0xa9, 0xa4, 0x25, 0x12, 0x38, 0x7f, 0x92, 0xee, 0xc1, 0x34, 0xbd, 0xe5, 0x28, 0xb6, 0x2b, 0x61, 0xe9, 0x95, 0x6f, 0x9f, 0xb3, 0xc7, 0xd6, 0x5e, 0x19, 0x45, 0xda, 0x34, 0xf3, 0x09
|
||||
],
|
||||
internal_ovk: [
|
||||
0x67, 0xa6, 0xd8, 0x4a, 0x81, 0x66, 0x32, 0x6c, 0xf3, 0x4c, 0xed, 0xff, 0xd4, 0x29, 0x8a, 0x13, 0xb8, 0x01, 0xcb, 0x12, 0x2d, 0x5f, 0x33, 0x29, 0xa1, 0x59, 0x9f, 0x31, 0xea, 0xdf, 0x5b, 0x17
|
||||
],
|
||||
internal_dk: [
|
||||
0xa0, 0x07, 0x3a, 0xdd, 0xfb, 0x89, 0xc9, 0xcc, 0x34, 0x9e, 0xad, 0x5a, 0x92, 0xb7, 0xd4, 0x17, 0xfe, 0x0e, 0x61, 0xf4, 0xa7, 0xe5, 0x66, 0x69, 0xc9, 0x07, 0xd4, 0x17, 0x46, 0xc0, 0x72, 0xb9
|
||||
],
|
||||
note_v: 625536973899669523,
|
||||
note_rho: [
|
||||
0x03, 0xfd, 0x69, 0x44, 0x2e, 0xb7, 0x68, 0x1e, 0xc2, 0xa0, 0x56, 0x00, 0x05, 0x4e, 0x92, 0xee, 0xd5, 0x55, 0x02, 0x8f, 0x21, 0xb6, 0xa1, 0x55, 0x26, 0x8a, 0x2d, 0xd6, 0x64, 0x0a, 0x69, 0x30
|
||||
|
|
|
@ -54,7 +54,11 @@ class SpendingKey:
|
|||
|
||||
class FullViewingKey(object):
|
||||
def __init__(self, sk):
|
||||
(self.rivk, self.ak, self.nk) = (sk.rivk, sk.ak, sk.nk)
|
||||
if isinstance(sk, SpendingKey):
|
||||
(self.rivk, self.ak, self.nk) = (sk.rivk, sk.ak, sk.nk)
|
||||
else:
|
||||
(self.rivk, self.ak, self.nk) = sk
|
||||
|
||||
K = i2leosp(256, self.rivk.s)
|
||||
R = prf_expand(K, b'\x82' + i2leosp(256, self.ak.s) + i2leosp(256, self.nk.s))
|
||||
self.dk = R[:32]
|
||||
|
@ -73,6 +77,11 @@ class FullViewingKey(object):
|
|||
def default_pkd(self):
|
||||
return self.default_gd() * Scalar(self.ivk().s)
|
||||
|
||||
def internal(self):
|
||||
K = i2leosp(256, self.rivk.s)
|
||||
rivk_internal = to_scalar(prf_expand(K, b'\x83' + i2leosp(256, self.ak.s) + i2leosp(256, self.nk.s)))
|
||||
return self.__class__((rivk_internal, self.ak, self.nk))
|
||||
|
||||
|
||||
def main():
|
||||
args = render_args()
|
||||
|
@ -109,6 +118,7 @@ def main():
|
|||
note_cm = note.note_commitment()
|
||||
note_nf = derive_nullifier(fvk.nk, note_rho, note.psi, note_cm)
|
||||
|
||||
internal = fvk.internal()
|
||||
test_vectors.append({
|
||||
'sk': sk.data,
|
||||
'ask': bytes(sk.ask),
|
||||
|
@ -120,6 +130,10 @@ def main():
|
|||
'dk': fvk.dk,
|
||||
'default_d': default_d,
|
||||
'default_pk_d': bytes(default_pk_d),
|
||||
'internal_rivk': bytes(internal.rivk),
|
||||
'internal_ivk': bytes(internal.ivk()),
|
||||
'internal_ovk': internal.ovk,
|
||||
'internal_dk': internal.dk,
|
||||
'note_v': note_v,
|
||||
'note_rho': bytes(note_rho),
|
||||
'note_rseed': bytes(note_rseed),
|
||||
|
@ -141,6 +155,10 @@ def main():
|
|||
('dk', '[u8; 32]'),
|
||||
('default_d', '[u8; 11]'),
|
||||
('default_pk_d', '[u8; 32]'),
|
||||
('internal_rivk', '[u8; 32]'),
|
||||
('internal_ivk', '[u8; 32]'),
|
||||
('internal_ovk', '[u8; 32]'),
|
||||
('internal_dk', '[u8; 32]'),
|
||||
('note_v', 'u64'),
|
||||
('note_rho', '[u8; 32]'),
|
||||
('note_rseed', '[u8; 32]'),
|
||||
|
|
Loading…
Reference in New Issue