Add poseidon_fq test vectors
This commit is contained in:
parent
657b67ecb2
commit
bbec810925
|
@ -0,0 +1,15 @@
|
|||
[
|
||||
["From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/poseidon_fq.py"],
|
||||
["initial_state, final_state"],
|
||||
[["0000000000000000000000000000000000000000000000000000000000000000", "0100000000000000000000000000000000000000000000000000000000000000", "0200000000000000000000000000000000000000000000000000000000000000"], ["59bebe13a88eb00ec636d33d97d1434df72f8f2ff274dded7c2f94db4c1f5a31", "f165a11ee626f1f99821bd7bebe03e4148aa13dde0de2a64de2b64d7f275e43b", "d9a07b2a3742d514a03f42e0d4bf195060ead82024db7f11687153e9ec8aab25"]],
|
||||
[["5c7a8f73794257087e634c49ac6b57074c4d6e66b164939daffa2ef6ee692108", "1add86b38a6d8ac0a6fd9e0d982b77e6b0ef9ca3f24988c7b3534201cfb1cd0d", "bd69b825ca4161296efa7f669ba9c7271fe01f7e9c8e36d6a5e29d4e30a73514"], ["cd8f8392dfc7728f5f6d854cc46070a40cba7a80332ddc65cbe24ac3de235e0e", "c253e5953c83aa8a23d4d5587fbfc07e78331f7d46d1f5fa544d6abdd4241b27", "b8c8339bf9472ad1c527b75e99812ca91c5cbd7f4d466f1a135a675066766434"]],
|
||||
[["bc509842b9a762e558ea5147ed5ac00862c2fa7b2fecbcb64b6968912a63810e", "3dc166d56a1d62f5a8d7551db5fd9313e8c7203d996af7d477083756d59af80d", "05a745f429c5dce84e0c20fdf0f03ebf8130ab33362697b0e4e4c763ccb8f636"], ["a35b5664624a78499ecee0fa051879a2ad1ca4539b5bd2a467e2ea8d4e2d4008", "36c2217ae575aaf8f254d6e060101cdc85aa393c09543bf048997a7c5cb92702", "38127ebeaf11ae5664471405293b601c43f03e8e4078113a633710119f9a1b1f"]],
|
||||
[["495c222f7fba1e31defa3d5a57efc2e1e9b01a035587d5fb1a38e01d94903d3c", "3d0ad336eb31f083ce29770e42988d7d25c9a138f49b1a537edcf04be34a9811", "a4af9db6364d03993d50353d88395ed7a41b0052ad8084a8b9da948d320dad16"], ["5c76634fc71a437a3cc7899db3b51ceae69ad00b1496a68032d3831737087918", "d3cc4eab450aacc45f9b327ebb9a50b859ca080e106b54c31c09c21e1d79df2a", "091e8f1ee9ba00a3e3cf85d5d6953d25e01e8bdb43de0fb730824e6a8f697e1c"]],
|
||||
[["4d5431e6db08d874695c3eaf345b86c4121fc00fe7f235734276d38d47f1e111", "dd0c7a1de5ed2fc38e5e607a3fdeab3fb679f3dc601d008285edcbdae69ce83c", "19e4aac0cd1be4050242f4d12053db33f73476f21a482ec9378365c8f7393c14"], ["00ff3c20d5ac2833e6d38427d04406179e31f3ded0e033ab4f51fcb428f8391b", "2a637aa04fb80d9c50f316b6367fa4f6ed52d07c99a13029d93faed3dd1ebc2f", "123154bb876013945f5469349d5fc3fcfcc9d2dab806430d496946f3bf2b6111"]],
|
||||
[["e2885315eb4671098b79535e790fe53e29fef2b3766697ac32b4f473f468a008", "e62389fce29cc6eb2e07ebc5ae25f9f783b27db59a4a153d882d2b2103596515", "eb9494c66ab3ae30b7e609d991f433bf9486a7afcf4a0d9c731e985d99589c0b"], ["e71eb48851d773b5a3b5d2b6f6eb01c3793f2febdfd1b953f06fa959c726bc18", "3771f829fbf27487f1df2b5ee994970b14d713ceae73a63395784dcdf9aa3030", "4806aff75ed3c6b9721bc5230dd776f92744629097cf5c2b7f142cf274a50737"]],
|
||||
[["b738e8aad65a0cb2fb3f1a3120372e831a20da8aba18d1dbebbc862ded42431e", "91476930af7e42e02188563853d93467e001afa2fb8dc3436d75a4a6f2657210", "4b192232ecb9f0c02411e52596bc5e90457e745939ffedbd12863ce71a02af11"], ["9d581608948ad015f53882c02d22402f71bd527ab6b0bdab5eafef0cd941e833", "f469d9806d0b9d92466bbde4904b882d29cc456defa4773f5d9a92796c60ed1d", "3cf1a73835f9425d4687a09beacf489aa60ecbfcaea061c97ed372861c080a3d"]],
|
||||
[["7b417adbfb3e3e3c2160d3d16f1e7f268fb86b12b56da9c382857deecc40a90d", "5e2935393df92fa1f47168b261aeb3786dd984d567db2857b927b7fae2db5831", "05415d4642789d38f50b8dbcc129cab3d17d19f3355bcf73cecb8cb8a5da0130"], ["732c0183417fdf3343c1ef69fdf6b3e7fd529ee8446348f2785074afe297e539", "c033d01cb2297f14dccf8a37c8900209465cc7412450e0b08284f9aaa118de34", "17f9a6653893ea76be600020b8ffbfd953ae4a94ad00104337b9f7de69886031"]],
|
||||
[["7152f13936a270572670dc82d39026c6cb4cd4b0f7f5aa2a4f5a5341ec5dd715", "406f2fdd2afa733f5f641c8c21862a1bafce2609d9eecfa158cfb5cd79f88008", "e215dc7d629da0e039d9681e993844543624c25fa959cc97489ce75745824b37"], ["160a24984862eae0a333507b3611931371c61d8e657138cfb2fa3b0f4de5ed3b", "c5bd5a0044b6dbfe88b697f71ea055b4e23242666bf4e1b02752eece08fbe805", "3034dc8e8d4f6e335383b901358ae4b75fccc72269db833789ced4c0ad83251e"]],
|
||||
[["868c53239cfbdf73caec65604037314faaceb56218c6bd30f8374ac13386793f", "21a9fb80ad03bc0cda4a44946c00e1b1a1df0e5b87b5bece477a709649e95006", "04913948f1a9d79205e1c682c738070af6556df6ed4b4ddd3d9a69f53357d736"], ["63e63f14cc49ec8f599333ae042cb40c6fa85f2d6764dead13164404978b1203", "c561f387b4aa3260090f01738801b534be396a13ee116b21db761069593db62f", "101a4bfd5689d55aa70ecf446dc31a89bc62deb7ed36f549199ce17bace7321b"]],
|
||||
[["7d4f5ccb99ef084b5725cfebd5d63dc16a95e3025b9792fff7f244fc71626939", "26d62e9596fa825c6bf21aff9e68625a192440ea06828123d97884806f15fa08", "d952754aefa99c733d14c8da014786da3a6128aef784a64610a89d1a7099212d"], ["45ed5417407bfdb797bcfe7074dff80e32a562ed8873781dbcf4f67e06be0c23", "132f3f55d8fbfd467b2ae22b8c64934364cf9c4a0b07edb40287c392c9c14512", "d051c37ff64cada2b482f11f8564396b75e3f81b3552d89af492cf00523c0415"]]
|
||||
]
|
|
@ -0,0 +1,15 @@
|
|||
[
|
||||
["From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/poseidon_fq_hash.py"],
|
||||
["input, output"],
|
||||
[["0000000000000000000000000000000000000000000000000000000000000000", "0100000000000000000000000000000000000000000000000000000000000000"], "4e68f685702957f3bf546b7a0901314e514f195ee3b1644622779d93df96ba15"],
|
||||
[["5c7a8f73794257087e634c49ac6b57074c4d6e66b164939daffa2ef6ee692108", "1add86b38a6d8ac0a6fd9e0d982b77e6b0ef9ca3f24988c7b3534201cfb1cd0d"], "0c0ad90a2e0cba0ee6a55ac538a435c9390498aeb5303e3dad703ad1dcdb432b"],
|
||||
[["bd69b825ca4161296efa7f669ba9c7271fe01f7e9c8e36d6a5e29d4e30a73514", "bc509842b9a762e558ea5147ed5ac00862c2fa7b2fecbcb64b6968912a63810e"], "a60cc8b853afcedba14465d531c73cbce19e460ba804622df521231da121c608"],
|
||||
[["3dc166d56a1d62f5a8d7551db5fd9313e8c7203d996af7d477083756d59af80d", "05a745f429c5dce84e0c20fdf0f03ebf8130ab33362697b0e4e4c763ccb8f636"], "ada8cae46a042d00b02e33c36e658c2213fe8134538b560319e999f3f5829000"],
|
||||
[["495c222f7fba1e31defa3d5a57efc2e1e9b01a035587d5fb1a38e01d94903d3c", "3d0ad336eb31f083ce29770e42988d7d25c9a138f49b1a537edcf04be34a9811"], "19949fc7740499370058127d040f11245eba6c3780e93e2616f4c1775630782d"],
|
||||
[["a4af9db6364d03993d50353d88395ed7a41b0052ad8084a8b9da948d320dad16", "4d5431e6db08d874695c3eaf345b86c4121fc00fe7f235734276d38d47f1e111"], "296ebab4b45ab92097a7e6e7cc6dd7d47a123e8550a33df120cca53890671b21"],
|
||||
[["dd0c7a1de5ed2fc38e5e607a3fdeab3fb679f3dc601d008285edcbdae69ce83c", "19e4aac0cd1be4050242f4d12053db33f73476f21a482ec9378365c8f7393c14"], "a8876e8d2f300a62054b494c8f21c1d0adbdac89bf2aad9f3c1b10c4788c2d3d"],
|
||||
[["e2885315eb4671098b79535e790fe53e29fef2b3766697ac32b4f473f468a008", "e62389fce29cc6eb2e07ebc5ae25f9f783b27db59a4a153d882d2b2103596515"], "c2dacb1eeaed880b87d04dd96195730e98bd0f14777b3ef0da40e4c087b19d28"],
|
||||
[["eb9494c66ab3ae30b7e609d991f433bf9486a7afcf4a0d9c731e985d99589c0b", "b738e8aad65a0cb2fb3f1a3120372e831a20da8aba18d1dbebbc862ded42431e"], "5a55e3082e55a566b9cab1caf448f70f8c9a53a1c9f69e2a80ddb8583f990126"],
|
||||
[["91476930af7e42e02188563853d93467e001afa2fb8dc3436d75a4a6f2657210", "4b192232ecb9f0c02411e52596bc5e90457e745939ffedbd12863ce71a02af11"], "cac6688a3d2a7dcae1d4601f9bf06d58008f24856ae600f0e0900723afa12003"],
|
||||
[["7b417adbfb3e3e3c2160d3d16f1e7f268fb86b12b56da9c382857deecc40a90d", "5e2935393df92fa1f47168b261aeb3786dd984d567db2857b927b7fae2db5831"], "d7e783919783b08b5fad089d571ec18fb4632853993f35e3ee543d4eedf65f38"]
|
||||
]
|
|
@ -0,0 +1,140 @@
|
|||
struct TestVector {
|
||||
initial_state: [[u8; 32]; 3],
|
||||
final_state: [[u8; 32]; 3],
|
||||
};
|
||||
|
||||
// From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/poseidon_fq.py
|
||||
let test_vectors = vec![
|
||||
TestVector {
|
||||
initial_state: [
|
||||
[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
[0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
[0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
],
|
||||
final_state: [
|
||||
[0x59, 0xbe, 0xbe, 0x13, 0xa8, 0x8e, 0xb0, 0x0e, 0xc6, 0x36, 0xd3, 0x3d, 0x97, 0xd1, 0x43, 0x4d, 0xf7, 0x2f, 0x8f, 0x2f, 0xf2, 0x74, 0xdd, 0xed, 0x7c, 0x2f, 0x94, 0xdb, 0x4c, 0x1f, 0x5a, 0x31],
|
||||
[0xf1, 0x65, 0xa1, 0x1e, 0xe6, 0x26, 0xf1, 0xf9, 0x98, 0x21, 0xbd, 0x7b, 0xeb, 0xe0, 0x3e, 0x41, 0x48, 0xaa, 0x13, 0xdd, 0xe0, 0xde, 0x2a, 0x64, 0xde, 0x2b, 0x64, 0xd7, 0xf2, 0x75, 0xe4, 0x3b],
|
||||
[0xd9, 0xa0, 0x7b, 0x2a, 0x37, 0x42, 0xd5, 0x14, 0xa0, 0x3f, 0x42, 0xe0, 0xd4, 0xbf, 0x19, 0x50, 0x60, 0xea, 0xd8, 0x20, 0x24, 0xdb, 0x7f, 0x11, 0x68, 0x71, 0x53, 0xe9, 0xec, 0x8a, 0xab, 0x25],
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
initial_state: [
|
||||
[0x5c, 0x7a, 0x8f, 0x73, 0x79, 0x42, 0x57, 0x08, 0x7e, 0x63, 0x4c, 0x49, 0xac, 0x6b, 0x57, 0x07, 0x4c, 0x4d, 0x6e, 0x66, 0xb1, 0x64, 0x93, 0x9d, 0xaf, 0xfa, 0x2e, 0xf6, 0xee, 0x69, 0x21, 0x08],
|
||||
[0x1a, 0xdd, 0x86, 0xb3, 0x8a, 0x6d, 0x8a, 0xc0, 0xa6, 0xfd, 0x9e, 0x0d, 0x98, 0x2b, 0x77, 0xe6, 0xb0, 0xef, 0x9c, 0xa3, 0xf2, 0x49, 0x88, 0xc7, 0xb3, 0x53, 0x42, 0x01, 0xcf, 0xb1, 0xcd, 0x0d],
|
||||
[0xbd, 0x69, 0xb8, 0x25, 0xca, 0x41, 0x61, 0x29, 0x6e, 0xfa, 0x7f, 0x66, 0x9b, 0xa9, 0xc7, 0x27, 0x1f, 0xe0, 0x1f, 0x7e, 0x9c, 0x8e, 0x36, 0xd6, 0xa5, 0xe2, 0x9d, 0x4e, 0x30, 0xa7, 0x35, 0x14],
|
||||
],
|
||||
final_state: [
|
||||
[0xcd, 0x8f, 0x83, 0x92, 0xdf, 0xc7, 0x72, 0x8f, 0x5f, 0x6d, 0x85, 0x4c, 0xc4, 0x60, 0x70, 0xa4, 0x0c, 0xba, 0x7a, 0x80, 0x33, 0x2d, 0xdc, 0x65, 0xcb, 0xe2, 0x4a, 0xc3, 0xde, 0x23, 0x5e, 0x0e],
|
||||
[0xc2, 0x53, 0xe5, 0x95, 0x3c, 0x83, 0xaa, 0x8a, 0x23, 0xd4, 0xd5, 0x58, 0x7f, 0xbf, 0xc0, 0x7e, 0x78, 0x33, 0x1f, 0x7d, 0x46, 0xd1, 0xf5, 0xfa, 0x54, 0x4d, 0x6a, 0xbd, 0xd4, 0x24, 0x1b, 0x27],
|
||||
[0xb8, 0xc8, 0x33, 0x9b, 0xf9, 0x47, 0x2a, 0xd1, 0xc5, 0x27, 0xb7, 0x5e, 0x99, 0x81, 0x2c, 0xa9, 0x1c, 0x5c, 0xbd, 0x7f, 0x4d, 0x46, 0x6f, 0x1a, 0x13, 0x5a, 0x67, 0x50, 0x66, 0x76, 0x64, 0x34],
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
initial_state: [
|
||||
[0xbc, 0x50, 0x98, 0x42, 0xb9, 0xa7, 0x62, 0xe5, 0x58, 0xea, 0x51, 0x47, 0xed, 0x5a, 0xc0, 0x08, 0x62, 0xc2, 0xfa, 0x7b, 0x2f, 0xec, 0xbc, 0xb6, 0x4b, 0x69, 0x68, 0x91, 0x2a, 0x63, 0x81, 0x0e],
|
||||
[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],
|
||||
[0x05, 0xa7, 0x45, 0xf4, 0x29, 0xc5, 0xdc, 0xe8, 0x4e, 0x0c, 0x20, 0xfd, 0xf0, 0xf0, 0x3e, 0xbf, 0x81, 0x30, 0xab, 0x33, 0x36, 0x26, 0x97, 0xb0, 0xe4, 0xe4, 0xc7, 0x63, 0xcc, 0xb8, 0xf6, 0x36],
|
||||
],
|
||||
final_state: [
|
||||
[0xa3, 0x5b, 0x56, 0x64, 0x62, 0x4a, 0x78, 0x49, 0x9e, 0xce, 0xe0, 0xfa, 0x05, 0x18, 0x79, 0xa2, 0xad, 0x1c, 0xa4, 0x53, 0x9b, 0x5b, 0xd2, 0xa4, 0x67, 0xe2, 0xea, 0x8d, 0x4e, 0x2d, 0x40, 0x08],
|
||||
[0x36, 0xc2, 0x21, 0x7a, 0xe5, 0x75, 0xaa, 0xf8, 0xf2, 0x54, 0xd6, 0xe0, 0x60, 0x10, 0x1c, 0xdc, 0x85, 0xaa, 0x39, 0x3c, 0x09, 0x54, 0x3b, 0xf0, 0x48, 0x99, 0x7a, 0x7c, 0x5c, 0xb9, 0x27, 0x02],
|
||||
[0x38, 0x12, 0x7e, 0xbe, 0xaf, 0x11, 0xae, 0x56, 0x64, 0x47, 0x14, 0x05, 0x29, 0x3b, 0x60, 0x1c, 0x43, 0xf0, 0x3e, 0x8e, 0x40, 0x78, 0x11, 0x3a, 0x63, 0x37, 0x10, 0x11, 0x9f, 0x9a, 0x1b, 0x1f],
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
initial_state: [
|
||||
[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],
|
||||
[0x3d, 0x0a, 0xd3, 0x36, 0xeb, 0x31, 0xf0, 0x83, 0xce, 0x29, 0x77, 0x0e, 0x42, 0x98, 0x8d, 0x7d, 0x25, 0xc9, 0xa1, 0x38, 0xf4, 0x9b, 0x1a, 0x53, 0x7e, 0xdc, 0xf0, 0x4b, 0xe3, 0x4a, 0x98, 0x11],
|
||||
[0xa4, 0xaf, 0x9d, 0xb6, 0x36, 0x4d, 0x03, 0x99, 0x3d, 0x50, 0x35, 0x3d, 0x88, 0x39, 0x5e, 0xd7, 0xa4, 0x1b, 0x00, 0x52, 0xad, 0x80, 0x84, 0xa8, 0xb9, 0xda, 0x94, 0x8d, 0x32, 0x0d, 0xad, 0x16],
|
||||
],
|
||||
final_state: [
|
||||
[0x5c, 0x76, 0x63, 0x4f, 0xc7, 0x1a, 0x43, 0x7a, 0x3c, 0xc7, 0x89, 0x9d, 0xb3, 0xb5, 0x1c, 0xea, 0xe6, 0x9a, 0xd0, 0x0b, 0x14, 0x96, 0xa6, 0x80, 0x32, 0xd3, 0x83, 0x17, 0x37, 0x08, 0x79, 0x18],
|
||||
[0xd3, 0xcc, 0x4e, 0xab, 0x45, 0x0a, 0xac, 0xc4, 0x5f, 0x9b, 0x32, 0x7e, 0xbb, 0x9a, 0x50, 0xb8, 0x59, 0xca, 0x08, 0x0e, 0x10, 0x6b, 0x54, 0xc3, 0x1c, 0x09, 0xc2, 0x1e, 0x1d, 0x79, 0xdf, 0x2a],
|
||||
[0x09, 0x1e, 0x8f, 0x1e, 0xe9, 0xba, 0x00, 0xa3, 0xe3, 0xcf, 0x85, 0xd5, 0xd6, 0x95, 0x3d, 0x25, 0xe0, 0x1e, 0x8b, 0xdb, 0x43, 0xde, 0x0f, 0xb7, 0x30, 0x82, 0x4e, 0x6a, 0x8f, 0x69, 0x7e, 0x1c],
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
initial_state: [
|
||||
[0x4d, 0x54, 0x31, 0xe6, 0xdb, 0x08, 0xd8, 0x74, 0x69, 0x5c, 0x3e, 0xaf, 0x34, 0x5b, 0x86, 0xc4, 0x12, 0x1f, 0xc0, 0x0f, 0xe7, 0xf2, 0x35, 0x73, 0x42, 0x76, 0xd3, 0x8d, 0x47, 0xf1, 0xe1, 0x11],
|
||||
[0xdd, 0x0c, 0x7a, 0x1d, 0xe5, 0xed, 0x2f, 0xc3, 0x8e, 0x5e, 0x60, 0x7a, 0x3f, 0xde, 0xab, 0x3f, 0xb6, 0x79, 0xf3, 0xdc, 0x60, 0x1d, 0x00, 0x82, 0x85, 0xed, 0xcb, 0xda, 0xe6, 0x9c, 0xe8, 0x3c],
|
||||
[0x19, 0xe4, 0xaa, 0xc0, 0xcd, 0x1b, 0xe4, 0x05, 0x02, 0x42, 0xf4, 0xd1, 0x20, 0x53, 0xdb, 0x33, 0xf7, 0x34, 0x76, 0xf2, 0x1a, 0x48, 0x2e, 0xc9, 0x37, 0x83, 0x65, 0xc8, 0xf7, 0x39, 0x3c, 0x14],
|
||||
],
|
||||
final_state: [
|
||||
[0x00, 0xff, 0x3c, 0x20, 0xd5, 0xac, 0x28, 0x33, 0xe6, 0xd3, 0x84, 0x27, 0xd0, 0x44, 0x06, 0x17, 0x9e, 0x31, 0xf3, 0xde, 0xd0, 0xe0, 0x33, 0xab, 0x4f, 0x51, 0xfc, 0xb4, 0x28, 0xf8, 0x39, 0x1b],
|
||||
[0x2a, 0x63, 0x7a, 0xa0, 0x4f, 0xb8, 0x0d, 0x9c, 0x50, 0xf3, 0x16, 0xb6, 0x36, 0x7f, 0xa4, 0xf6, 0xed, 0x52, 0xd0, 0x7c, 0x99, 0xa1, 0x30, 0x29, 0xd9, 0x3f, 0xae, 0xd3, 0xdd, 0x1e, 0xbc, 0x2f],
|
||||
[0x12, 0x31, 0x54, 0xbb, 0x87, 0x60, 0x13, 0x94, 0x5f, 0x54, 0x69, 0x34, 0x9d, 0x5f, 0xc3, 0xfc, 0xfc, 0xc9, 0xd2, 0xda, 0xb8, 0x06, 0x43, 0x0d, 0x49, 0x69, 0x46, 0xf3, 0xbf, 0x2b, 0x61, 0x11],
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
initial_state: [
|
||||
[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],
|
||||
[0xe6, 0x23, 0x89, 0xfc, 0xe2, 0x9c, 0xc6, 0xeb, 0x2e, 0x07, 0xeb, 0xc5, 0xae, 0x25, 0xf9, 0xf7, 0x83, 0xb2, 0x7d, 0xb5, 0x9a, 0x4a, 0x15, 0x3d, 0x88, 0x2d, 0x2b, 0x21, 0x03, 0x59, 0x65, 0x15],
|
||||
[0xeb, 0x94, 0x94, 0xc6, 0x6a, 0xb3, 0xae, 0x30, 0xb7, 0xe6, 0x09, 0xd9, 0x91, 0xf4, 0x33, 0xbf, 0x94, 0x86, 0xa7, 0xaf, 0xcf, 0x4a, 0x0d, 0x9c, 0x73, 0x1e, 0x98, 0x5d, 0x99, 0x58, 0x9c, 0x0b],
|
||||
],
|
||||
final_state: [
|
||||
[0xe7, 0x1e, 0xb4, 0x88, 0x51, 0xd7, 0x73, 0xb5, 0xa3, 0xb5, 0xd2, 0xb6, 0xf6, 0xeb, 0x01, 0xc3, 0x79, 0x3f, 0x2f, 0xeb, 0xdf, 0xd1, 0xb9, 0x53, 0xf0, 0x6f, 0xa9, 0x59, 0xc7, 0x26, 0xbc, 0x18],
|
||||
[0x37, 0x71, 0xf8, 0x29, 0xfb, 0xf2, 0x74, 0x87, 0xf1, 0xdf, 0x2b, 0x5e, 0xe9, 0x94, 0x97, 0x0b, 0x14, 0xd7, 0x13, 0xce, 0xae, 0x73, 0xa6, 0x33, 0x95, 0x78, 0x4d, 0xcd, 0xf9, 0xaa, 0x30, 0x30],
|
||||
[0x48, 0x06, 0xaf, 0xf7, 0x5e, 0xd3, 0xc6, 0xb9, 0x72, 0x1b, 0xc5, 0x23, 0x0d, 0xd7, 0x76, 0xf9, 0x27, 0x44, 0x62, 0x90, 0x97, 0xcf, 0x5c, 0x2b, 0x7f, 0x14, 0x2c, 0xf2, 0x74, 0xa5, 0x07, 0x37],
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
initial_state: [
|
||||
[0xb7, 0x38, 0xe8, 0xaa, 0xd6, 0x5a, 0x0c, 0xb2, 0xfb, 0x3f, 0x1a, 0x31, 0x20, 0x37, 0x2e, 0x83, 0x1a, 0x20, 0xda, 0x8a, 0xba, 0x18, 0xd1, 0xdb, 0xeb, 0xbc, 0x86, 0x2d, 0xed, 0x42, 0x43, 0x1e],
|
||||
[0x91, 0x47, 0x69, 0x30, 0xaf, 0x7e, 0x42, 0xe0, 0x21, 0x88, 0x56, 0x38, 0x53, 0xd9, 0x34, 0x67, 0xe0, 0x01, 0xaf, 0xa2, 0xfb, 0x8d, 0xc3, 0x43, 0x6d, 0x75, 0xa4, 0xa6, 0xf2, 0x65, 0x72, 0x10],
|
||||
[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],
|
||||
],
|
||||
final_state: [
|
||||
[0x9d, 0x58, 0x16, 0x08, 0x94, 0x8a, 0xd0, 0x15, 0xf5, 0x38, 0x82, 0xc0, 0x2d, 0x22, 0x40, 0x2f, 0x71, 0xbd, 0x52, 0x7a, 0xb6, 0xb0, 0xbd, 0xab, 0x5e, 0xaf, 0xef, 0x0c, 0xd9, 0x41, 0xe8, 0x33],
|
||||
[0xf4, 0x69, 0xd9, 0x80, 0x6d, 0x0b, 0x9d, 0x92, 0x46, 0x6b, 0xbd, 0xe4, 0x90, 0x4b, 0x88, 0x2d, 0x29, 0xcc, 0x45, 0x6d, 0xef, 0xa4, 0x77, 0x3f, 0x5d, 0x9a, 0x92, 0x79, 0x6c, 0x60, 0xed, 0x1d],
|
||||
[0x3c, 0xf1, 0xa7, 0x38, 0x35, 0xf9, 0x42, 0x5d, 0x46, 0x87, 0xa0, 0x9b, 0xea, 0xcf, 0x48, 0x9a, 0xa6, 0x0e, 0xcb, 0xfc, 0xae, 0xa0, 0x61, 0xc9, 0x7e, 0xd3, 0x72, 0x86, 0x1c, 0x08, 0x0a, 0x3d],
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
initial_state: [
|
||||
[0x7b, 0x41, 0x7a, 0xdb, 0xfb, 0x3e, 0x3e, 0x3c, 0x21, 0x60, 0xd3, 0xd1, 0x6f, 0x1e, 0x7f, 0x26, 0x8f, 0xb8, 0x6b, 0x12, 0xb5, 0x6d, 0xa9, 0xc3, 0x82, 0x85, 0x7d, 0xee, 0xcc, 0x40, 0xa9, 0x0d],
|
||||
[0x5e, 0x29, 0x35, 0x39, 0x3d, 0xf9, 0x2f, 0xa1, 0xf4, 0x71, 0x68, 0xb2, 0x61, 0xae, 0xb3, 0x78, 0x6d, 0xd9, 0x84, 0xd5, 0x67, 0xdb, 0x28, 0x57, 0xb9, 0x27, 0xb7, 0xfa, 0xe2, 0xdb, 0x58, 0x31],
|
||||
[0x05, 0x41, 0x5d, 0x46, 0x42, 0x78, 0x9d, 0x38, 0xf5, 0x0b, 0x8d, 0xbc, 0xc1, 0x29, 0xca, 0xb3, 0xd1, 0x7d, 0x19, 0xf3, 0x35, 0x5b, 0xcf, 0x73, 0xce, 0xcb, 0x8c, 0xb8, 0xa5, 0xda, 0x01, 0x30],
|
||||
],
|
||||
final_state: [
|
||||
[0x73, 0x2c, 0x01, 0x83, 0x41, 0x7f, 0xdf, 0x33, 0x43, 0xc1, 0xef, 0x69, 0xfd, 0xf6, 0xb3, 0xe7, 0xfd, 0x52, 0x9e, 0xe8, 0x44, 0x63, 0x48, 0xf2, 0x78, 0x50, 0x74, 0xaf, 0xe2, 0x97, 0xe5, 0x39],
|
||||
[0xc0, 0x33, 0xd0, 0x1c, 0xb2, 0x29, 0x7f, 0x14, 0xdc, 0xcf, 0x8a, 0x37, 0xc8, 0x90, 0x02, 0x09, 0x46, 0x5c, 0xc7, 0x41, 0x24, 0x50, 0xe0, 0xb0, 0x82, 0x84, 0xf9, 0xaa, 0xa1, 0x18, 0xde, 0x34],
|
||||
[0x17, 0xf9, 0xa6, 0x65, 0x38, 0x93, 0xea, 0x76, 0xbe, 0x60, 0x00, 0x20, 0xb8, 0xff, 0xbf, 0xd9, 0x53, 0xae, 0x4a, 0x94, 0xad, 0x00, 0x10, 0x43, 0x37, 0xb9, 0xf7, 0xde, 0x69, 0x88, 0x60, 0x31],
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
initial_state: [
|
||||
[0x71, 0x52, 0xf1, 0x39, 0x36, 0xa2, 0x70, 0x57, 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, 0x5f, 0x64, 0x1c, 0x8c, 0x21, 0x86, 0x2a, 0x1b, 0xaf, 0xce, 0x26, 0x09, 0xd9, 0xee, 0xcf, 0xa1, 0x58, 0xcf, 0xb5, 0xcd, 0x79, 0xf8, 0x80, 0x08],
|
||||
[0xe2, 0x15, 0xdc, 0x7d, 0x62, 0x9d, 0xa0, 0xe0, 0x39, 0xd9, 0x68, 0x1e, 0x99, 0x38, 0x44, 0x54, 0x36, 0x24, 0xc2, 0x5f, 0xa9, 0x59, 0xcc, 0x97, 0x48, 0x9c, 0xe7, 0x57, 0x45, 0x82, 0x4b, 0x37],
|
||||
],
|
||||
final_state: [
|
||||
[0x16, 0x0a, 0x24, 0x98, 0x48, 0x62, 0xea, 0xe0, 0xa3, 0x33, 0x50, 0x7b, 0x36, 0x11, 0x93, 0x13, 0x71, 0xc6, 0x1d, 0x8e, 0x65, 0x71, 0x38, 0xcf, 0xb2, 0xfa, 0x3b, 0x0f, 0x4d, 0xe5, 0xed, 0x3b],
|
||||
[0xc5, 0xbd, 0x5a, 0x00, 0x44, 0xb6, 0xdb, 0xfe, 0x88, 0xb6, 0x97, 0xf7, 0x1e, 0xa0, 0x55, 0xb4, 0xe2, 0x32, 0x42, 0x66, 0x6b, 0xf4, 0xe1, 0xb0, 0x27, 0x52, 0xee, 0xce, 0x08, 0xfb, 0xe8, 0x05],
|
||||
[0x30, 0x34, 0xdc, 0x8e, 0x8d, 0x4f, 0x6e, 0x33, 0x53, 0x83, 0xb9, 0x01, 0x35, 0x8a, 0xe4, 0xb7, 0x5f, 0xcc, 0xc7, 0x22, 0x69, 0xdb, 0x83, 0x37, 0x89, 0xce, 0xd4, 0xc0, 0xad, 0x83, 0x25, 0x1e],
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
initial_state: [
|
||||
[0x86, 0x8c, 0x53, 0x23, 0x9c, 0xfb, 0xdf, 0x73, 0xca, 0xec, 0x65, 0x60, 0x40, 0x37, 0x31, 0x4f, 0xaa, 0xce, 0xb5, 0x62, 0x18, 0xc6, 0xbd, 0x30, 0xf8, 0x37, 0x4a, 0xc1, 0x33, 0x86, 0x79, 0x3f],
|
||||
[0x21, 0xa9, 0xfb, 0x80, 0xad, 0x03, 0xbc, 0x0c, 0xda, 0x4a, 0x44, 0x94, 0x6c, 0x00, 0xe1, 0xb1, 0xa1, 0xdf, 0x0e, 0x5b, 0x87, 0xb5, 0xbe, 0xce, 0x47, 0x7a, 0x70, 0x96, 0x49, 0xe9, 0x50, 0x06],
|
||||
[0x04, 0x91, 0x39, 0x48, 0xf1, 0xa9, 0xd7, 0x92, 0x05, 0xe1, 0xc6, 0x82, 0xc7, 0x38, 0x07, 0x0a, 0xf6, 0x55, 0x6d, 0xf6, 0xed, 0x4b, 0x4d, 0xdd, 0x3d, 0x9a, 0x69, 0xf5, 0x33, 0x57, 0xd7, 0x36],
|
||||
],
|
||||
final_state: [
|
||||
[0x63, 0xe6, 0x3f, 0x14, 0xcc, 0x49, 0xec, 0x8f, 0x59, 0x93, 0x33, 0xae, 0x04, 0x2c, 0xb4, 0x0c, 0x6f, 0xa8, 0x5f, 0x2d, 0x67, 0x64, 0xde, 0xad, 0x13, 0x16, 0x44, 0x04, 0x97, 0x8b, 0x12, 0x03],
|
||||
[0xc5, 0x61, 0xf3, 0x87, 0xb4, 0xaa, 0x32, 0x60, 0x09, 0x0f, 0x01, 0x73, 0x88, 0x01, 0xb5, 0x34, 0xbe, 0x39, 0x6a, 0x13, 0xee, 0x11, 0x6b, 0x21, 0xdb, 0x76, 0x10, 0x69, 0x59, 0x3d, 0xb6, 0x2f],
|
||||
[0x10, 0x1a, 0x4b, 0xfd, 0x56, 0x89, 0xd5, 0x5a, 0xa7, 0x0e, 0xcf, 0x44, 0x6d, 0xc3, 0x1a, 0x89, 0xbc, 0x62, 0xde, 0xb7, 0xed, 0x36, 0xf5, 0x49, 0x19, 0x9c, 0xe1, 0x7b, 0xac, 0xe7, 0x32, 0x1b],
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
initial_state: [
|
||||
[0x7d, 0x4f, 0x5c, 0xcb, 0x99, 0xef, 0x08, 0x4b, 0x57, 0x25, 0xcf, 0xeb, 0xd5, 0xd6, 0x3d, 0xc1, 0x6a, 0x95, 0xe3, 0x02, 0x5b, 0x97, 0x92, 0xff, 0xf7, 0xf2, 0x44, 0xfc, 0x71, 0x62, 0x69, 0x39],
|
||||
[0x26, 0xd6, 0x2e, 0x95, 0x96, 0xfa, 0x82, 0x5c, 0x6b, 0xf2, 0x1a, 0xff, 0x9e, 0x68, 0x62, 0x5a, 0x19, 0x24, 0x40, 0xea, 0x06, 0x82, 0x81, 0x23, 0xd9, 0x78, 0x84, 0x80, 0x6f, 0x15, 0xfa, 0x08],
|
||||
[0xd9, 0x52, 0x75, 0x4a, 0xef, 0xa9, 0x9c, 0x73, 0x3d, 0x14, 0xc8, 0xda, 0x01, 0x47, 0x86, 0xda, 0x3a, 0x61, 0x28, 0xae, 0xf7, 0x84, 0xa6, 0x46, 0x10, 0xa8, 0x9d, 0x1a, 0x70, 0x99, 0x21, 0x2d],
|
||||
],
|
||||
final_state: [
|
||||
[0x45, 0xed, 0x54, 0x17, 0x40, 0x7b, 0xfd, 0xb7, 0x97, 0xbc, 0xfe, 0x70, 0x74, 0xdf, 0xf8, 0x0e, 0x32, 0xa5, 0x62, 0xed, 0x88, 0x73, 0x78, 0x1d, 0xbc, 0xf4, 0xf6, 0x7e, 0x06, 0xbe, 0x0c, 0x23],
|
||||
[0x13, 0x2f, 0x3f, 0x55, 0xd8, 0xfb, 0xfd, 0x46, 0x7b, 0x2a, 0xe2, 0x2b, 0x8c, 0x64, 0x93, 0x43, 0x64, 0xcf, 0x9c, 0x4a, 0x0b, 0x07, 0xed, 0xb4, 0x02, 0x87, 0xc3, 0x92, 0xc9, 0xc1, 0x45, 0x12],
|
||||
[0xd0, 0x51, 0xc3, 0x7f, 0xf6, 0x4c, 0xad, 0xa2, 0xb4, 0x82, 0xf1, 0x1f, 0x85, 0x64, 0x39, 0x6b, 0x75, 0xe3, 0xf8, 0x1b, 0x35, 0x52, 0xd8, 0x9a, 0xf4, 0x92, 0xcf, 0x00, 0x52, 0x3c, 0x04, 0x15],
|
||||
],
|
||||
},
|
||||
];
|
|
@ -0,0 +1,107 @@
|
|||
struct TestVector {
|
||||
input: [[u8; 32]; 2],
|
||||
output: [u8; 32],
|
||||
};
|
||||
|
||||
// From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/poseidon_fq_hash.py
|
||||
let test_vectors = vec![
|
||||
TestVector {
|
||||
input: [
|
||||
[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
[0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
],
|
||||
output: [
|
||||
0x4e, 0x68, 0xf6, 0x85, 0x70, 0x29, 0x57, 0xf3, 0xbf, 0x54, 0x6b, 0x7a, 0x09, 0x01, 0x31, 0x4e, 0x51, 0x4f, 0x19, 0x5e, 0xe3, 0xb1, 0x64, 0x46, 0x22, 0x77, 0x9d, 0x93, 0xdf, 0x96, 0xba, 0x15
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
input: [
|
||||
[0x5c, 0x7a, 0x8f, 0x73, 0x79, 0x42, 0x57, 0x08, 0x7e, 0x63, 0x4c, 0x49, 0xac, 0x6b, 0x57, 0x07, 0x4c, 0x4d, 0x6e, 0x66, 0xb1, 0x64, 0x93, 0x9d, 0xaf, 0xfa, 0x2e, 0xf6, 0xee, 0x69, 0x21, 0x08],
|
||||
[0x1a, 0xdd, 0x86, 0xb3, 0x8a, 0x6d, 0x8a, 0xc0, 0xa6, 0xfd, 0x9e, 0x0d, 0x98, 0x2b, 0x77, 0xe6, 0xb0, 0xef, 0x9c, 0xa3, 0xf2, 0x49, 0x88, 0xc7, 0xb3, 0x53, 0x42, 0x01, 0xcf, 0xb1, 0xcd, 0x0d],
|
||||
],
|
||||
output: [
|
||||
0x0c, 0x0a, 0xd9, 0x0a, 0x2e, 0x0c, 0xba, 0x0e, 0xe6, 0xa5, 0x5a, 0xc5, 0x38, 0xa4, 0x35, 0xc9, 0x39, 0x04, 0x98, 0xae, 0xb5, 0x30, 0x3e, 0x3d, 0xad, 0x70, 0x3a, 0xd1, 0xdc, 0xdb, 0x43, 0x2b
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
input: [
|
||||
[0xbd, 0x69, 0xb8, 0x25, 0xca, 0x41, 0x61, 0x29, 0x6e, 0xfa, 0x7f, 0x66, 0x9b, 0xa9, 0xc7, 0x27, 0x1f, 0xe0, 0x1f, 0x7e, 0x9c, 0x8e, 0x36, 0xd6, 0xa5, 0xe2, 0x9d, 0x4e, 0x30, 0xa7, 0x35, 0x14],
|
||||
[0xbc, 0x50, 0x98, 0x42, 0xb9, 0xa7, 0x62, 0xe5, 0x58, 0xea, 0x51, 0x47, 0xed, 0x5a, 0xc0, 0x08, 0x62, 0xc2, 0xfa, 0x7b, 0x2f, 0xec, 0xbc, 0xb6, 0x4b, 0x69, 0x68, 0x91, 0x2a, 0x63, 0x81, 0x0e],
|
||||
],
|
||||
output: [
|
||||
0xa6, 0x0c, 0xc8, 0xb8, 0x53, 0xaf, 0xce, 0xdb, 0xa1, 0x44, 0x65, 0xd5, 0x31, 0xc7, 0x3c, 0xbc, 0xe1, 0x9e, 0x46, 0x0b, 0xa8, 0x04, 0x62, 0x2d, 0xf5, 0x21, 0x23, 0x1d, 0xa1, 0x21, 0xc6, 0x08
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
input: [
|
||||
[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],
|
||||
[0x05, 0xa7, 0x45, 0xf4, 0x29, 0xc5, 0xdc, 0xe8, 0x4e, 0x0c, 0x20, 0xfd, 0xf0, 0xf0, 0x3e, 0xbf, 0x81, 0x30, 0xab, 0x33, 0x36, 0x26, 0x97, 0xb0, 0xe4, 0xe4, 0xc7, 0x63, 0xcc, 0xb8, 0xf6, 0x36],
|
||||
],
|
||||
output: [
|
||||
0xad, 0xa8, 0xca, 0xe4, 0x6a, 0x04, 0x2d, 0x00, 0xb0, 0x2e, 0x33, 0xc3, 0x6e, 0x65, 0x8c, 0x22, 0x13, 0xfe, 0x81, 0x34, 0x53, 0x8b, 0x56, 0x03, 0x19, 0xe9, 0x99, 0xf3, 0xf5, 0x82, 0x90, 0x00
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
input: [
|
||||
[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],
|
||||
[0x3d, 0x0a, 0xd3, 0x36, 0xeb, 0x31, 0xf0, 0x83, 0xce, 0x29, 0x77, 0x0e, 0x42, 0x98, 0x8d, 0x7d, 0x25, 0xc9, 0xa1, 0x38, 0xf4, 0x9b, 0x1a, 0x53, 0x7e, 0xdc, 0xf0, 0x4b, 0xe3, 0x4a, 0x98, 0x11],
|
||||
],
|
||||
output: [
|
||||
0x19, 0x94, 0x9f, 0xc7, 0x74, 0x04, 0x99, 0x37, 0x00, 0x58, 0x12, 0x7d, 0x04, 0x0f, 0x11, 0x24, 0x5e, 0xba, 0x6c, 0x37, 0x80, 0xe9, 0x3e, 0x26, 0x16, 0xf4, 0xc1, 0x77, 0x56, 0x30, 0x78, 0x2d
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
input: [
|
||||
[0xa4, 0xaf, 0x9d, 0xb6, 0x36, 0x4d, 0x03, 0x99, 0x3d, 0x50, 0x35, 0x3d, 0x88, 0x39, 0x5e, 0xd7, 0xa4, 0x1b, 0x00, 0x52, 0xad, 0x80, 0x84, 0xa8, 0xb9, 0xda, 0x94, 0x8d, 0x32, 0x0d, 0xad, 0x16],
|
||||
[0x4d, 0x54, 0x31, 0xe6, 0xdb, 0x08, 0xd8, 0x74, 0x69, 0x5c, 0x3e, 0xaf, 0x34, 0x5b, 0x86, 0xc4, 0x12, 0x1f, 0xc0, 0x0f, 0xe7, 0xf2, 0x35, 0x73, 0x42, 0x76, 0xd3, 0x8d, 0x47, 0xf1, 0xe1, 0x11],
|
||||
],
|
||||
output: [
|
||||
0x29, 0x6e, 0xba, 0xb4, 0xb4, 0x5a, 0xb9, 0x20, 0x97, 0xa7, 0xe6, 0xe7, 0xcc, 0x6d, 0xd7, 0xd4, 0x7a, 0x12, 0x3e, 0x85, 0x50, 0xa3, 0x3d, 0xf1, 0x20, 0xcc, 0xa5, 0x38, 0x90, 0x67, 0x1b, 0x21
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
input: [
|
||||
[0xdd, 0x0c, 0x7a, 0x1d, 0xe5, 0xed, 0x2f, 0xc3, 0x8e, 0x5e, 0x60, 0x7a, 0x3f, 0xde, 0xab, 0x3f, 0xb6, 0x79, 0xf3, 0xdc, 0x60, 0x1d, 0x00, 0x82, 0x85, 0xed, 0xcb, 0xda, 0xe6, 0x9c, 0xe8, 0x3c],
|
||||
[0x19, 0xe4, 0xaa, 0xc0, 0xcd, 0x1b, 0xe4, 0x05, 0x02, 0x42, 0xf4, 0xd1, 0x20, 0x53, 0xdb, 0x33, 0xf7, 0x34, 0x76, 0xf2, 0x1a, 0x48, 0x2e, 0xc9, 0x37, 0x83, 0x65, 0xc8, 0xf7, 0x39, 0x3c, 0x14],
|
||||
],
|
||||
output: [
|
||||
0xa8, 0x87, 0x6e, 0x8d, 0x2f, 0x30, 0x0a, 0x62, 0x05, 0x4b, 0x49, 0x4c, 0x8f, 0x21, 0xc1, 0xd0, 0xad, 0xbd, 0xac, 0x89, 0xbf, 0x2a, 0xad, 0x9f, 0x3c, 0x1b, 0x10, 0xc4, 0x78, 0x8c, 0x2d, 0x3d
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
input: [
|
||||
[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],
|
||||
[0xe6, 0x23, 0x89, 0xfc, 0xe2, 0x9c, 0xc6, 0xeb, 0x2e, 0x07, 0xeb, 0xc5, 0xae, 0x25, 0xf9, 0xf7, 0x83, 0xb2, 0x7d, 0xb5, 0x9a, 0x4a, 0x15, 0x3d, 0x88, 0x2d, 0x2b, 0x21, 0x03, 0x59, 0x65, 0x15],
|
||||
],
|
||||
output: [
|
||||
0xc2, 0xda, 0xcb, 0x1e, 0xea, 0xed, 0x88, 0x0b, 0x87, 0xd0, 0x4d, 0xd9, 0x61, 0x95, 0x73, 0x0e, 0x98, 0xbd, 0x0f, 0x14, 0x77, 0x7b, 0x3e, 0xf0, 0xda, 0x40, 0xe4, 0xc0, 0x87, 0xb1, 0x9d, 0x28
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
input: [
|
||||
[0xeb, 0x94, 0x94, 0xc6, 0x6a, 0xb3, 0xae, 0x30, 0xb7, 0xe6, 0x09, 0xd9, 0x91, 0xf4, 0x33, 0xbf, 0x94, 0x86, 0xa7, 0xaf, 0xcf, 0x4a, 0x0d, 0x9c, 0x73, 0x1e, 0x98, 0x5d, 0x99, 0x58, 0x9c, 0x0b],
|
||||
[0xb7, 0x38, 0xe8, 0xaa, 0xd6, 0x5a, 0x0c, 0xb2, 0xfb, 0x3f, 0x1a, 0x31, 0x20, 0x37, 0x2e, 0x83, 0x1a, 0x20, 0xda, 0x8a, 0xba, 0x18, 0xd1, 0xdb, 0xeb, 0xbc, 0x86, 0x2d, 0xed, 0x42, 0x43, 0x1e],
|
||||
],
|
||||
output: [
|
||||
0x5a, 0x55, 0xe3, 0x08, 0x2e, 0x55, 0xa5, 0x66, 0xb9, 0xca, 0xb1, 0xca, 0xf4, 0x48, 0xf7, 0x0f, 0x8c, 0x9a, 0x53, 0xa1, 0xc9, 0xf6, 0x9e, 0x2a, 0x80, 0xdd, 0xb8, 0x58, 0x3f, 0x99, 0x01, 0x26
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
input: [
|
||||
[0x91, 0x47, 0x69, 0x30, 0xaf, 0x7e, 0x42, 0xe0, 0x21, 0x88, 0x56, 0x38, 0x53, 0xd9, 0x34, 0x67, 0xe0, 0x01, 0xaf, 0xa2, 0xfb, 0x8d, 0xc3, 0x43, 0x6d, 0x75, 0xa4, 0xa6, 0xf2, 0x65, 0x72, 0x10],
|
||||
[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],
|
||||
],
|
||||
output: [
|
||||
0xca, 0xc6, 0x68, 0x8a, 0x3d, 0x2a, 0x7d, 0xca, 0xe1, 0xd4, 0x60, 0x1f, 0x9b, 0xf0, 0x6d, 0x58, 0x00, 0x8f, 0x24, 0x85, 0x6a, 0xe6, 0x00, 0xf0, 0xe0, 0x90, 0x07, 0x23, 0xaf, 0xa1, 0x20, 0x03
|
||||
],
|
||||
},
|
||||
TestVector {
|
||||
input: [
|
||||
[0x7b, 0x41, 0x7a, 0xdb, 0xfb, 0x3e, 0x3e, 0x3c, 0x21, 0x60, 0xd3, 0xd1, 0x6f, 0x1e, 0x7f, 0x26, 0x8f, 0xb8, 0x6b, 0x12, 0xb5, 0x6d, 0xa9, 0xc3, 0x82, 0x85, 0x7d, 0xee, 0xcc, 0x40, 0xa9, 0x0d],
|
||||
[0x5e, 0x29, 0x35, 0x39, 0x3d, 0xf9, 0x2f, 0xa1, 0xf4, 0x71, 0x68, 0xb2, 0x61, 0xae, 0xb3, 0x78, 0x6d, 0xd9, 0x84, 0xd5, 0x67, 0xdb, 0x28, 0x57, 0xb9, 0x27, 0xb7, 0xfa, 0xe2, 0xdb, 0x58, 0x31],
|
||||
],
|
||||
output: [
|
||||
0xd7, 0xe7, 0x83, 0x91, 0x97, 0x83, 0xb0, 0x8b, 0x5f, 0xad, 0x08, 0x9d, 0x57, 0x1e, 0xc1, 0x8f, 0xb4, 0x63, 0x28, 0x53, 0x99, 0x3f, 0x35, 0xe3, 0xee, 0x54, 0x3d, 0x4e, 0xed, 0xf6, 0x5f, 0x38
|
||||
],
|
||||
},
|
||||
];
|
|
@ -0,0 +1,15 @@
|
|||
[
|
||||
["From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/poseidon_fq.py"],
|
||||
["initial_state, final_state"],
|
||||
[["0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000002"], ["315a1f4cdb942f7ceddd74f22f8f2ff74d43d1973dd336c60eb08ea813bebe59", "3be475f2d7642bde642adee0dd13aa48413ee0eb7bbd2198f9f126e61ea165f1", "25ab8aece9537168117fdb2420d8ea605019bfd4e0423fa014d542372a7ba0d9"]],
|
||||
[["082169eef62efaaf9d9364b1666e4d4c07576bac494c637e08574279738f7a5c", "0dcdb1cf014253b3c78849f2a39cefb0e6772b980d9efda6c08a6d8ab386dd1a", "1435a7304e9de2a5d6368e9c7e1fe01f27c7a99b667ffa6e296141ca25b869bd"], ["0e5e23dec34ae2cb65dc2d33807aba0ca47060c44c856d5f8f72c7df92838fcd", "271b24d4bd6a4d54faf5d1467d1f33787ec0bf7f58d5d4238aaa833c95e553c2", "3464766650675a131a6f464d7fbd5c1ca92c81995eb727c5d12a47f99b33c8b8"]],
|
||||
[["0e81632a9168694bb6bcec2f7bfac26208c05aed4751ea58e562a7b9429850bc", "0df89ad556370877d4f76a993d20c7e81393fdb51d55d7a8f5621d6ad566c13d", "36f6b8cc63c7e4e4b097263633ab3081bf3ef0f0fd200c4ee8dcc529f445a705"], ["08402d4e8deae267a4d25b9b53a41cada2791805fae0ce9e49784a6264565ba3", "0227b95c7c7a9948f03b54093c39aa85dc1c1060e0d654f2f8aa75e57a21c236", "1f1b9a9f111037633a1178408e3ef0431c603b290514476456ae11afbe7e1238"]],
|
||||
[["3c3d90941de0381afbd58755031ab0e9e1c2ef575a3dfade311eba7f2f225c49", "11984ae34bf0dc7e531a9bf438a1c9257d8d98420e7729ce83f031eb36d30a3d", "16ad0d328d94dab9a88480ad52001ba4d75e39883d35503d99034d36b69dafa4"], ["187908371783d33280a696140bd09ae6ea1cb5b39d89c73c7a431ac74f63765c", "2adf791d1ec2091cc3546b100e08ca59b8509abb7e329b5fc4ac0a45ab4eccd3", "1c7e698f6a4e8230b70fde43db8b1ee0253d95d6d585cfe3a300bae91e8f1e09"]],
|
||||
[["11e1f1478dd376427335f2e70fc01f12c4865b34af3e5c6974d808dbe631544d", "3ce89ce6dacbed8582001d60dcf379b63fabde3f7a605e8ec32fede51d7a0cdd", "143c39f7c8658337c92e481af27634f733db5320d1f4420205e41bcdc0aae419"], ["1b39f828b4fc514fab33e0d0def3319e170644d02784d3e63328acd5203cff00", "2fbc1eddd3ae3fd92930a1997cd052edf6a47f36b616f3509c0db84fa07a632a", "11612bbff34669490d4306b8dad2c9fcfcc35f9d3469545f94136087bb543112"]],
|
||||
[["08a068f473f4b432ac976676b3f2fe293ee50f795e53798b097146eb155388e2", "15655903212b2d883d154a9ab57db283f7f925aec5eb072eebc69ce2fc8923e6", "0b9c58995d981e739c0d4acfafa78694bf33f491d909e6b730aeb36ac69494eb"], ["18bc26c759a96ff053b9d1dfeb2f3f79c301ebf6b6d2b5a3b573d75188b41ee7", "3030aaf9cd4d789533a673aece13d7140b9794e95e2bdff18774f2fb29f87137", "3707a574f22c147f2b5ccf9790624427f976d70d23c51b72b9c6d35ef7af0648"]],
|
||||
[["1e4342ed2d86bcebdbd118ba8ada201a832e3720311a3ffbb20c5ad6aae838b7", "107265f2a6a4756d43c38dfba2af01e06734d95338568821e0427eaf30694791", "11af021ae73c8612bdedff3959747e45905ebc9625e51124c0f0b9ec3222194b"], ["33e841d90cefaf5eabbdb0b67a52bd712f40222dc08238f515d08a940816589d", "1ded606c79929a5d3f77a4ef6d45cc292d884b90e4bd6b46929d0b6d80d969f4", "3d0a081c8672d37ec961a0aefccb0ea69a48cfea9ba087465d42f93538a7f13c"]],
|
||||
[["0da940ccee7d8582c3a96db5126bb88f267f1e6fd1d360213c3e3efbdb7a417b", "3158dbe2fab727b95728db67d584d96d78b3ae61b26871f4a12ff93d3935295e", "3001daa5b88ccbce73cf5b35f3197dd1b3ca29c1bc8d0bf5389d7842465d4105"], ["39e597e2af745078f2486344e89e52fde7b3f6fd69efc14333df7f4183012c73", "34de18a1aaf98482b0e0502441c75c46090290c8378acfdc147f29b21cd033c0", "31608869def7b937431000ad944aae53d9bfffb8200060be76ea933865a6f917"]],
|
||||
[["15d75dec41535a4f2aaaf5f7b0d44ccbc62690d382dc70265770a23639f15271", "0880f879cdb5cf58a1cfeed90926ceaf1b2a86218c1c645f3f73fa2add2f6f40", "374b824557e79c4897cc59a95fc22436544438991e68d939e0a09d627ddc15e2"], ["3bede54d0f3bfab2cf3871658e1dc671139311367b5033a3e0ea624898240a16", "05e8fb08ceee5227b0e1f46b664232e2b455a01ef797b688fedbb644005abdc5", "1e2583adc0d4ce893783db6922c7cc5fb7e48a3501b98353336e4f8d8edc3430"]],
|
||||
[["3f798633c14a37f830bdc61862b5ceaa4f3137406065ecca73dffb9c23538c86", "0650e94996707a47cebeb5875b0edfa1b1e1006c94444ada0cbc03ad80fba921", "36d75733f5699a3ddd4d4bedf66d55f60a0738c782c6e10592d7a9f148399104"], ["03128b9704441613adde64672d5fa86f0cb42c04ae3393598fec49cc143fe663", "2fb63d59691076db216b11ee136a39be34b5018873010f096032aab487f361c5", "1b32e7ac7be19c1949f536edb7de62bc891ac36d44cf0ea75ad58956fd4b1a10"]],
|
||||
[["39696271fc44f2f7ff92975b02e3956ac13dd6d5ebcf25574b08ef99cb5c4f7d", "08fa156f808478d923818206ea4024195a62689eff1af26b5c82fa96952ed626", "2d2199701a9da81046a684f7ae28613ada864701dac8143d739ca9ef4a7552d9"], ["230cbe067ef6f4bc1d787388ed62a5320ef8df7470febc97b7fd7b401754ed45", "1245c1c992c38702b4ed070b4a9ccf644393648c2be22a7b46fdfbd8553f2f13", "15043c5200cf92f49ad852351bf8e3756b3964851ff182b4a2ad4cf67fc351d0"]]
|
||||
]
|
|
@ -0,0 +1,15 @@
|
|||
[
|
||||
["From https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/poseidon_fq_hash.py"],
|
||||
["input, output"],
|
||||
[["0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000001"], "15ba96df939d77224664b1e35e194f514e3101097a6b54bff357297085f6684e"],
|
||||
[["082169eef62efaaf9d9364b1666e4d4c07576bac494c637e08574279738f7a5c", "0dcdb1cf014253b3c78849f2a39cefb0e6772b980d9efda6c08a6d8ab386dd1a"], "2b43dbdcd13a70ad3d3e30b5ae980439c935a438c55aa5e60eba0c2e0ad90a0c"],
|
||||
[["1435a7304e9de2a5d6368e9c7e1fe01f27c7a99b667ffa6e296141ca25b869bd", "0e81632a9168694bb6bcec2f7bfac26208c05aed4751ea58e562a7b9429850bc"], "08c621a11d2321f52d6204a80b469ee1bc3cc731d56544a1dbceaf53b8c80ca6"],
|
||||
[["0df89ad556370877d4f76a993d20c7e81393fdb51d55d7a8f5621d6ad566c13d", "36f6b8cc63c7e4e4b097263633ab3081bf3ef0f0fd200c4ee8dcc529f445a705"], "009082f5f399e91903568b533481fe13228c656ec3332eb0002d046ae4caa8ad"],
|
||||
[["3c3d90941de0381afbd58755031ab0e9e1c2ef575a3dfade311eba7f2f225c49", "11984ae34bf0dc7e531a9bf438a1c9257d8d98420e7729ce83f031eb36d30a3d"], "2d78305677c1f416263ee980376cba5e24110f047d12580037990474c79f9419"],
|
||||
[["16ad0d328d94dab9a88480ad52001ba4d75e39883d35503d99034d36b69dafa4", "11e1f1478dd376427335f2e70fc01f12c4865b34af3e5c6974d808dbe631544d"], "211b679038a5cc20f13da350853e127ad4d76dcce7e6a79720b95ab4b4ba6e29"],
|
||||
[["3ce89ce6dacbed8582001d60dcf379b63fabde3f7a605e8ec32fede51d7a0cdd", "143c39f7c8658337c92e481af27634f733db5320d1f4420205e41bcdc0aae419"], "3d2d8c78c4101b3c9fad2abf89acbdadd0c1218f4c494b05620a302f8d6e87a8"],
|
||||
[["08a068f473f4b432ac976676b3f2fe293ee50f795e53798b097146eb155388e2", "15655903212b2d883d154a9ab57db283f7f925aec5eb072eebc69ce2fc8923e6"], "289db187c0e440daf03e7b77140fbd980e739561d94dd0870b88edea1ecbdac2"],
|
||||
[["0b9c58995d981e739c0d4acfafa78694bf33f491d909e6b730aeb36ac69494eb", "1e4342ed2d86bcebdbd118ba8ada201a832e3720311a3ffbb20c5ad6aae838b7"], "2601993f58b8dd802a9ef6c9a1539a8c0ff748f4cab1cab966a5552e08e3555a"],
|
||||
[["107265f2a6a4756d43c38dfba2af01e06734d95338568821e0427eaf30694791", "11af021ae73c8612bdedff3959747e45905ebc9625e51124c0f0b9ec3222194b"], "0320a1af230790e0f000e66a85248f00586df09b1f60d4e1ca7d2a3d8a68c6ca"],
|
||||
[["0da940ccee7d8582c3a96db5126bb88f267f1e6fd1d360213c3e3efbdb7a417b", "3158dbe2fab727b95728db67d584d96d78b3ae61b26871f4a12ff93d3935295e"], "385ff6ed4e3d54eee3353f99532863b48fc11e579d08ad5f8bb083979183e7d7"]
|
||||
]
|
Loading…
Reference in New Issue