mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-02-17 20:03:21 +00:00
update tests
Update tests for LEE domain separator.
This commit is contained in:
parent
eaee772c86
commit
75beecc6b9
@ -37,7 +37,7 @@ impl ChildKeysPublic {
|
||||
|
||||
impl KeyNode for ChildKeysPublic {
|
||||
fn root(seed: [u8; 64]) -> Self {
|
||||
let hash_value = hmac_sha512::HMAC::mac(seed, "NSSA_master_pub");
|
||||
let hash_value = hmac_sha512::HMAC::mac(seed, "LEE_master_pub");
|
||||
|
||||
let csk = nssa::PrivateKey::try_new(*hash_value.first_chunk::<32>().unwrap()).unwrap();
|
||||
let ccc = *hash_value.last_chunk::<32>().unwrap();
|
||||
@ -113,25 +113,26 @@ mod tests {
|
||||
#[test]
|
||||
fn test_master_keys_generation() {
|
||||
let seed = [
|
||||
1, 130, 162, 216, 26, 234, 27, 234, 59, 207, 162, 21, 199, 134, 255, 150, 213, 185, 39,
|
||||
171, 190, 140, 144, 170, 180, 168, 36, 190, 35, 154, 32, 164, 91, 177, 221, 142, 190,
|
||||
150, 128, 72, 118, 124, 182, 223, 137, 172, 6, 133, 220, 55, 27, 24, 133, 23, 37, 193,
|
||||
212, 237, 51, 61, 74, 173, 70, 193,
|
||||
88, 189, 37, 237, 199, 125, 151, 226, 69, 153, 165, 113, 191, 69, 188, 221, 9, 34, 173,
|
||||
134, 61, 109, 34, 103, 121, 39, 237, 14, 107, 194, 24, 194, 191, 14, 237, 185, 12, 87,
|
||||
22, 227, 38, 71, 17, 144, 251, 118, 217, 115, 33, 222, 201, 61, 203, 246, 121, 214, 6,
|
||||
187, 148, 92, 44, 253, 210, 37,
|
||||
];
|
||||
let keys = ChildKeysPublic::root(seed);
|
||||
|
||||
let expected_ccc = [
|
||||
196, 136, 91, 61, 98, 123, 72, 161, 143, 192, 242, 133, 4, 231, 101, 199, 165, 79, 60,
|
||||
121, 165, 234, 179, 205, 227, 195, 116, 180, 114, 104, 63, 193,
|
||||
238, 94, 84, 154, 56, 224, 80, 218, 133, 249, 179, 222, 9, 24, 17, 252, 120, 127, 222,
|
||||
13, 146, 126, 232, 239, 113, 9, 194, 219, 190, 48, 187, 155,
|
||||
];
|
||||
|
||||
let expected_csk: PrivateKey = PrivateKey::try_new([
|
||||
122, 75, 152, 80, 233, 219, 100, 140, 106, 84, 74, 60, 102, 92, 23, 83, 17, 195, 122,
|
||||
33, 12, 39, 154, 247, 68, 132, 125, 236, 182, 123, 129, 91,
|
||||
40, 35, 239, 19, 53, 178, 250, 55, 115, 12, 34, 3, 153, 153, 72, 170, 190, 36, 172, 36,
|
||||
202, 148, 181, 228, 35, 222, 58, 84, 156, 24, 146, 86,
|
||||
])
|
||||
.unwrap();
|
||||
let expected_cpk: PublicKey = PublicKey::try_new([
|
||||
91, 160, 2, 88, 187, 86, 42, 53, 237, 131, 141, 208, 218, 40, 81, 209, 221, 89, 134,
|
||||
127, 254, 249, 21, 38, 186, 139, 232, 134, 253, 97, 83, 149,
|
||||
219, 141, 130, 105, 11, 203, 187, 124, 112, 75, 223, 22, 11, 164, 153, 127, 59, 247,
|
||||
244, 166, 75, 66, 242, 224, 35, 156, 161, 75, 41, 51, 76, 245,
|
||||
])
|
||||
.unwrap();
|
||||
|
||||
@ -159,19 +160,19 @@ mod tests {
|
||||
);
|
||||
|
||||
let expected_ccc = [
|
||||
1, 19, 186, 27, 153, 246, 163, 56, 19, 66, 184, 252, 125, 91, 229, 55, 22, 186, 129,
|
||||
78, 67, 38, 102, 167, 88, 237, 142, 162, 165, 105, 67, 250,
|
||||
126, 175, 244, 41, 41, 173, 134, 103, 139, 140, 195, 86, 194, 147, 116, 48, 71, 107,
|
||||
253, 235, 114, 139, 60, 115, 226, 205, 215, 248, 240, 190, 196, 6,
|
||||
];
|
||||
|
||||
let expected_csk: PrivateKey = PrivateKey::try_new([
|
||||
93, 255, 132, 159, 52, 30, 43, 128, 106, 84, 99, 16, 193, 37, 224, 142, 208, 87, 142,
|
||||
156, 175, 116, 90, 204, 157, 219, 136, 109, 230, 223, 76, 70,
|
||||
128, 148, 53, 165, 222, 155, 163, 108, 186, 182, 124, 67, 90, 86, 59, 123, 95, 224,
|
||||
171, 4, 51, 131, 254, 57, 241, 178, 82, 161, 204, 206, 79, 107,
|
||||
])
|
||||
.unwrap();
|
||||
|
||||
let expected_cpk: PublicKey = PublicKey::try_new([
|
||||
78, 123, 221, 195, 111, 255, 131, 167, 117, 146, 61, 161, 179, 51, 250, 25, 90, 187,
|
||||
190, 163, 30, 145, 212, 87, 88, 127, 86, 5, 45, 236, 184, 223,
|
||||
149, 240, 55, 15, 178, 67, 245, 254, 44, 141, 95, 223, 238, 62, 85, 11, 248, 9, 11, 40,
|
||||
69, 211, 116, 13, 189, 35, 8, 95, 233, 154, 129, 58,
|
||||
])
|
||||
.unwrap();
|
||||
|
||||
@ -199,19 +200,19 @@ mod tests {
|
||||
);
|
||||
|
||||
let expected_ccc = [
|
||||
189, 224, 117, 5, 91, 65, 195, 166, 97, 192, 203, 11, 254, 170, 159, 146, 234, 238,
|
||||
157, 155, 189, 197, 187, 190, 125, 127, 146, 20, 250, 174, 218, 111,
|
||||
50, 29, 113, 102, 49, 130, 64, 0, 247, 95, 135, 187, 118, 162, 65, 65, 194, 53, 189,
|
||||
242, 66, 178, 168, 2, 51, 193, 155, 72, 209, 2, 207, 251,
|
||||
];
|
||||
|
||||
let expected_csk: PrivateKey = PrivateKey::try_new([
|
||||
56, 213, 27, 113, 20, 234, 174, 150, 186, 32, 151, 177, 118, 37, 83, 181, 30, 71, 183,
|
||||
34, 174, 44, 143, 250, 65, 158, 106, 2, 239, 20, 194, 176,
|
||||
162, 32, 211, 190, 180, 74, 151, 246, 189, 93, 8, 57, 182, 239, 125, 245, 192, 255, 24,
|
||||
186, 251, 23, 194, 186, 252, 121, 190, 54, 147, 199, 1, 109,
|
||||
])
|
||||
.unwrap();
|
||||
|
||||
let expected_cpk: PublicKey = PublicKey::try_new([
|
||||
118, 202, 73, 30, 197, 237, 223, 167, 99, 45, 17, 251, 91, 168, 252, 158, 196, 243, 48,
|
||||
159, 253, 181, 224, 110, 177, 111, 115, 19, 247, 158, 202, 61,
|
||||
183, 48, 207, 170, 221, 111, 118, 9, 40, 67, 123, 162, 159, 169, 34, 157, 23, 37, 232,
|
||||
102, 231, 187, 199, 191, 205, 146, 159, 22, 79, 100, 10, 223,
|
||||
])
|
||||
.unwrap();
|
||||
|
||||
@ -239,19 +240,19 @@ mod tests {
|
||||
);
|
||||
|
||||
let expected_ccc = [
|
||||
196, 27, 223, 192, 33, 28, 41, 165, 247, 198, 251, 26, 63, 85, 223, 6, 57, 201, 10, 46,
|
||||
189, 152, 39, 69, 28, 30, 112, 167, 211, 175, 170, 75,
|
||||
210, 59, 14, 158, 52, 215, 216, 93, 160, 246, 178, 122, 211, 252, 0, 33, 248, 197, 242,
|
||||
243, 78, 210, 67, 55, 212, 147, 3, 12, 80, 132, 245, 139,
|
||||
];
|
||||
|
||||
let expected_csk: PrivateKey = PrivateKey::try_new([
|
||||
55, 68, 204, 198, 234, 171, 247, 60, 177, 24, 216, 130, 62, 115, 130, 156, 94, 90, 156,
|
||||
8, 160, 126, 14, 33, 214, 184, 79, 127, 88, 87, 95, 217,
|
||||
167, 114, 72, 184, 108, 61, 60, 219, 210, 140, 142, 224, 253, 204, 175, 165, 147, 135,
|
||||
43, 42, 9, 224, 164, 196, 179, 178, 169, 162, 41, 56, 161, 146,
|
||||
])
|
||||
.unwrap();
|
||||
|
||||
let expected_cpk: PublicKey = PublicKey::try_new([
|
||||
222, 5, 102, 223, 97, 95, 83, 100, 114, 154, 15, 248, 164, 117, 209, 125, 193, 19, 64,
|
||||
75, 245, 168, 52, 199, 45, 39, 237, 232, 175, 3, 167, 178,
|
||||
127, 243, 89, 67, 37, 211, 15, 39, 31, 110, 175, 89, 9, 102, 209, 99, 105, 194, 172, 8,
|
||||
194, 11, 207, 250, 1, 9, 6, 173, 49, 155, 130, 29,
|
||||
])
|
||||
.unwrap();
|
||||
|
||||
|
||||
@ -345,8 +345,8 @@ mod tests {
|
||||
|
||||
assert!(tree.key_map.contains_key(&ChainIndex::root()));
|
||||
assert!(tree.account_id_map.contains_key(&AccountId::new([
|
||||
46, 223, 229, 177, 59, 18, 189, 219, 153, 31, 249, 90, 112, 230, 180, 164, 80, 25, 106,
|
||||
159, 14, 238, 1, 192, 91, 8, 210, 165, 199, 41, 60, 104,
|
||||
185, 32, 154, 134, 186, 139, 229, 220, 43, 231, 207, 9, 34, 87, 157, 107, 12, 55, 133,
|
||||
177, 85, 96, 169, 108, 20, 243, 163, 138, 28, 74, 50, 14
|
||||
])));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user