diff --git a/data/bandersnatch_ed_sha512_ell2_ring_vectors.json b/data/bandersnatch_ed_sha512_ell2_ring_vectors.json new file mode 100644 index 0000000..b933169 --- /dev/null +++ b/data/bandersnatch_ed_sha512_ell2_ring_vectors.json @@ -0,0 +1,128 @@ +[ + { + "comment": "Bandersnatch_SHA-512_ELL2 - vector-1", + "sk": "3d6406500d4009fdf2604546093665911e753f2213570a29521fd88bc30ede18", + "pk": "a1b1da71cc4682e159b7da23050d8b6261eb11a3247c89b07ef56ccd002fd38b", + "alpha": "", + "ad": "", + "h": "b923c55b4b7d8c28156c87e005c6d8385a6f26019eee3149aaeb7ee7ce284b38", + "gamma": "208d1eacbedbfb00708a7068c708a565c0bd41c8155010c52e55c6837fecfa52", + "beta": "96b48404e1df9c738557ccbdfb5bc6f7b8fa3d281aa51742a5928e7a5d77cf5b4fc6ed61fc0f7e073dfc3ee8e06b1e5de55e93ecff8ad926cc99a08e8aa6a779", + "blinding": "7ce97a8ad77c9975dae7f961294cc3627b2e4d76c5bce12b569e921b4e6a0309", + "proof_pk_com": "6db8663c87c4abf4a72060bfdc7fa566bb3d3f5402d07422bd4b8e56e7598495", + "proof_r": "3d638578fd8a92946a83da63f13ab696d908b5b41dbdfd70379ae46b8e0ddba3", + "proof_ok": "647c218cec9610102b202bcf7d29bdbf91770c326f07586051fa40bee863b63e", + "proof_s": "7f27df1375f1217c4a34fa57b61de6b1cf7b023e17298ed53071b8dd95c32818", + "proof_sb": "1716ad8149314c978dc5f1ca626246166c50258225554eda646cc6d4b96e5e18", + "ring_pks": "7b32d917d5aa771d493c47b0e096886827cd056c82dbdba19e60baa8b2c60313d3b1bdb321123449c6e89d310bc6b7f654315eb471c84778353ce08b951ad471561fdb0dcfb8bd443718b942f82fe717238cbcf8d12b8d22861c8a09a984a3c5a1b1da71cc4682e159b7da23050d8b6261eb11a3247c89b07ef56ccd002fd38b4fd11f89c2a1aaefe856bb1c5d4a1fad73f4de5e41804ca2c17ba26d6e10050c86d06ee2c70da6cf2da2a828d8a9d8ef755ad6e580e838359a10accb086ae437ad6fdeda0dde0a57c51d3226b87e3795e6474393772da46101fd597fbd456c1b3f9dc0c4f67f207974123830c2d66988fb3fb44becbbba5a64143f376edc51d9", + "ring_proof": "8072d6dca9bd5d4b56a0c8b26c071bd9723264fcde82b898bac2eced2a5664c336a6dc0a97376cdc0189e4ee46df44fd914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114aa3ffbbd6b1036a95934e7669f5b26907fcb9ab071d048ef0a5774bc4ebe22ade7f9744af0d458ffb43ec218e4c755cbc811954d0eaf7f3d6d018607789174b5a563f76154f1f550f6982ee661a083b7fdddc238cfa8e5e47ea1bc0758823d65b4800cfac2542a37f18936c14f52436796e325bc14e10c4b21c8467e15f42690c2a0c28ec88968596dec6575e3de3ed18fb059921dbc2551af6ca060706e30910dbae72af35e2f77b6130fdaf2651deab5dc4619c23be23e94b2953f8ec037e29f3f11b016db9b2f6147e6dc639fa785e18d84bfbf93489f7d8b286b12d7976263e3c62efb0d49df7def9f436fe862972899421b11f1949698c7d6621115080322e56449440051b9c5d029bd88d72a302d7ebe15818d6851ba5ca63ef852cb6457d6d59a4bbb06514850b5fd855701d7484519507f1ba630d7bfd42b3b879526d88f94122c9596e0d932fdce71cef156c47a4678b8adade725ca06630cd326851687e92e7be8b68786d1819ce5494d5a4e51783eaf4651cd9280b7300c61912c3f0fb2a1df1166730b500b97d7df02860827ae296009ab6f6c14de8d239cb08a64afe3324c33c342ac7bb44fafb4f2adf45b5713efb865d2f839ad27780ca1f9a91f14be4e5b767eb0ca9dc658133e50b330c7f68e073d32abeaefc01425d799a0503a98dbf28d4306b13a1bae9d36cb2" + }, + { + "comment": "Bandersnatch_SHA-512_ELL2 - vector-2", + "sk": "8b9063872331dda4c3c282f7d813fb3c13e7339b7dc9635fdc764e32cc57cb15", + "pk": "5ebfe047f421e1a3e1d9bbb163839812657bbb3e4ffe9856a725b2b405844cf3", + "alpha": "0a", + "ad": "", + "h": "d905aaf894a97094b1d707ea7685fbc4ac501fc01cef25586a9c36288c5c6302", + "gamma": "25c5ab15ce5d973bfec7b6dd428b5b5971958a056d10cc18d5e9ccd0ee4c7b86", + "beta": "2ae6660f435f733482e4fb6a2c743288fc1d8a6b173b01f490929cd128514c518112bed1659bb8eab1535e279f9b7349fa316ba6f7bd8baa4ae410141bb565d2", + "blinding": "fd72b2c883f5b4bba8973a532d1dce1a69aabd08b9ab310e8073eee26fbf4410", + "proof_pk_com": "8a8a6ff54ece07a0b3e6370dc7c3dc4f01d35ddb8eeacd4c4ada90e5f18af848", + "proof_r": "8df706daf2a7482669fe1afcf32aaee4cf988423f8c384f6041b16e15716ec20", + "proof_ok": "83a9519edb8ecc4f360eee599c6c1310019c4c3451ca42b4887328e347003bdf", + "proof_s": "13362d25281e988c02e24a1e639bdc2839bdcca7eb9eec1a4305c44f27dea104", + "proof_sb": "fe20fa2d4ebfd45f414b3bea7eef827cc394d8ed04149ffb8232499f5b51b411", + "ring_pks": "7b32d917d5aa771d493c47b0e096886827cd056c82dbdba19e60baa8b2c60313d3b1bdb321123449c6e89d310bc6b7f654315eb471c84778353ce08b951ad471561fdb0dcfb8bd443718b942f82fe717238cbcf8d12b8d22861c8a09a984a3c55ebfe047f421e1a3e1d9bbb163839812657bbb3e4ffe9856a725b2b405844cf34fd11f89c2a1aaefe856bb1c5d4a1fad73f4de5e41804ca2c17ba26d6e10050c86d06ee2c70da6cf2da2a828d8a9d8ef755ad6e580e838359a10accb086ae437ad6fdeda0dde0a57c51d3226b87e3795e6474393772da46101fd597fbd456c1b3f9dc0c4f67f207974123830c2d66988fb3fb44becbbba5a64143f376edc51d9", + "ring_proof": "9158da07c31276fcc7025b759ea8e948389cf086c7eadc40dc9edbfefd50c9fc418dadfa03cbd728d96fdb0134833abb914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114a8f6afa587f697b3bba64b2c0a6f9178c546129f6a380c3d5b7f0884035d1cffcf3d587935acbcc0b6a77c7838eab1ea88e35707bba5d3a44eb0f77f0103a9f172dbdbef0a71839b87bbc921507908c601004a946ade9f93e4cb25687da0338cf9079d327ee8122cee3cea34d0afd002d796d814dcda0d824c5d8d1cb6f373141c8f561f712a5fcc846adae3ed77aef3b29023ccb4ba6278c749de8b56d3f663731d1ef12edfd7b79cd6f4687da6a4e91e3411013753edbc6db298dc05deb7725aa2d9f9b557d5da8dea055a6b6d09b055eaf3d502138f28bf0576c8ad142035ab573b077f1b60ebaa3c399212463c241d294aafc6490f40c891a2890e614810fe916a09d9e5b55ec82b12f577a5ed7df4f2a77628cb211c919aa383b4ad746449b7831314f58ac0bfa51608365b04e518a12bae26c1c63039d2bff852d2cf45795837827398b9963a6454c29ae6a7e5e56a14adf1423138247dd42f94a60559241e78e0720c7c41750874fb56093c846e9606b06698374a1115ca053872183da719d4d7d95769a01235b5008c9419825a8ea4dde1608f82d70e67c41dabf6ac2c08b4268284eb8ded8f7bb9eb892e9790af52841d213b3c4cf8145b41fe0ad3481d18225b760eb4cdc17177a35ba63fb8f1bc2efb8a437fbab20fa3eb91e4c8d970812767f6fe0bfb8f10c86057932aa" + }, + { + "comment": "Bandersnatch_SHA-512_ELL2 - vector-3", + "sk": "6db187202f69e627e432296ae1d0f166ae6ac3c1222585b6ceae80ea07670b14", + "pk": "9d97151298a5339866ddd3539d16696e19e6b68ac731562c807fe63a1ca49506", + "alpha": "", + "ad": "0b8c", + "h": "587f7c01731c52ce4e02405a9642bf39da4b62befa0a0811f00dd1710a975cc4", + "gamma": "002030eb901d08fe85873b46cd5a1bd2a2c9fbce4f15e9e39066c1fe91be1c1f", + "beta": "5ca9dc5e02e908b5f1de31c85d30a064353420ab930a541db5f518eee07fb059323df22d2ce82d36a5bac52aa322f08072cc0b9c555a5e4179e3c11a067de7a2", + "blinding": "751455f3d10f5159060ae2d74422106c8ce3f8ae631e81bb1f13a3994c92b906", + "proof_pk_com": "0e935dde3019269c7b68768806da3bb5bdbff8fc521df6eef76a2ad67c2a6643", + "proof_r": "7e22ec0ecf04165c52e69c65af4a84d2593fbc28582da055e1668026768e69a8", + "proof_ok": "d502f832afaddb7bb54e8c28cce458a2a9c3c6c230e4b85539913ec531de168b", + "proof_s": "f3713c659eb353f95d47b60e8bceef5c07e870da05ad3ae8410e9c4438105908", + "proof_sb": "c07ba2fc0e17f99cdee9f5c9ad42c721e4a67c8eba99540c1a1bf3ed13cc010a", + "ring_pks": "7b32d917d5aa771d493c47b0e096886827cd056c82dbdba19e60baa8b2c60313d3b1bdb321123449c6e89d310bc6b7f654315eb471c84778353ce08b951ad471561fdb0dcfb8bd443718b942f82fe717238cbcf8d12b8d22861c8a09a984a3c59d97151298a5339866ddd3539d16696e19e6b68ac731562c807fe63a1ca495064fd11f89c2a1aaefe856bb1c5d4a1fad73f4de5e41804ca2c17ba26d6e10050c86d06ee2c70da6cf2da2a828d8a9d8ef755ad6e580e838359a10accb086ae437ad6fdeda0dde0a57c51d3226b87e3795e6474393772da46101fd597fbd456c1b3f9dc0c4f67f207974123830c2d66988fb3fb44becbbba5a64143f376edc51d9", + "ring_proof": "923e908683f031385f051a83bddee05cd3bd9267140c7c05fbb273289a41109bec354d6996f58157e8f157b8e7bf5c2f914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114a91cab93928f88fc0e43f6f637c31cf177185ca5fc10168d597f4c11d494f2b46b04d666ebba2e0bbf867ae8c80b017fe8ad6a7e58bfeede95d5416007ea2981e50341a031efaad14e3192d7b0afb1f5e28ae49c8d811386c08c02835093d611c272b39e83b80547d3eec5d3ed89d616146f11be3ad676cefeeda32169863674d3b9acc647bf4040300ac52db4e484398d0bc0b94b035a2f7e9c98c95a74ae83ecb039761788222a945b825b22ce0f99763884e6b65d534394c6227eb8649ee20fddd4a6c4f161402d62116c5f41188e39438fac3f79df44690320ccbc48a63360c9b05d240abf933b16ab937fa6788c3899259a380efbaf41c354c1c0f4abf4c0f77c60e25c656f6bfab0bca06733a1d42be439c7186f957532c57e5a3eef33024eb17591db593634f1df5428b2aa0c222c0d5eb358cdfc1f5378bdcfafd597193ce4364557cb006d6a89d0372d4907e146e306765669bd6528ef519b161d8d3abe3af7167b50a2136e2103896cd0eb0d725ae8b0614654bbf9209845681e6986bde8ebc0cc2ee0f3a21f7e946fc7a6791bdcdd56cbb18d1cfd4b637db154d55a49906cfcff642e85dec0ae23bdafdb73add364d0e53afbff26e0b8aa7454192832e90b4320fef399f114c00b94a9763405bf2ac0d17c9d15445645e3e45dadb5edd42eab7651d9385a22e40ae0e2030" + }, + { + "comment": "Bandersnatch_SHA-512_ELL2 - vector-4", + "sk": "b56cc204f1b6c2323709012cb16c72f3021035ce935fbe69b600a88d842c7407", + "pk": "dc2de7312c2850a9f6c103289c64fbd76e2ebd2fa8b5734708eb2c76c0fb2d99", + "alpha": "73616d706c65", + "ad": "", + "h": "c1cde8432c5bf619b14a403d611140c117a52ba31004574238bd58bf8fc6181f", + "gamma": "5d5a673794b7a0003a1c36f299c4d61055e4b680bb3c2ccd8858dce89c6cd5d3", + "beta": "0db282523110f629d8c9424afa66f4dfcb9e6dcea5f7891ab2ffc09eeb72a0ac11ac36841ec72644a5d24c1fa879872d3091c5e5b81940761f9f8f378f5013ae", + "blinding": "36252630c1f32ee7951536ebc705bda5578486a94b5c98cf264b1b779806b40d", + "proof_pk_com": "15957fbc15aef7322af76e499cb879dd05860bb97842d163c20db94fc25e8637", + "proof_r": "e266c233784fc4c2b3dfe348e9e4a5e758c1f6e5b053685f42f2a57706ac9d90", + "proof_ok": "c59024c715d21f2a08fb0cd8cb24046558222c6753180853f9601d92186c5e3b", + "proof_s": "92baeb32b97ca7f056c1412c5f1b596f2328bc092d18b295a6e4553cbd547d0f", + "proof_sb": "0573a4a51cbf33b0cf23b1c82fbfc44735420f4f9d0b75f4f0f0258fdd3b3c05", + "ring_pks": "7b32d917d5aa771d493c47b0e096886827cd056c82dbdba19e60baa8b2c60313d3b1bdb321123449c6e89d310bc6b7f654315eb471c84778353ce08b951ad471561fdb0dcfb8bd443718b942f82fe717238cbcf8d12b8d22861c8a09a984a3c5dc2de7312c2850a9f6c103289c64fbd76e2ebd2fa8b5734708eb2c76c0fb2d994fd11f89c2a1aaefe856bb1c5d4a1fad73f4de5e41804ca2c17ba26d6e10050c86d06ee2c70da6cf2da2a828d8a9d8ef755ad6e580e838359a10accb086ae437ad6fdeda0dde0a57c51d3226b87e3795e6474393772da46101fd597fbd456c1b3f9dc0c4f67f207974123830c2d66988fb3fb44becbbba5a64143f376edc51d9", + "ring_proof": "a74b52f2cdf144dff3c35e5b95bff1955bc87c1e77c2ffb6d468b5828903dc213d9d60e1afe8145f76c46b1319c1c3d3914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114ab937718f09d38733a49705c8477e9b3a17199ef6671dfba4117d14fc57c14cb87964738cfa09df6ad6ed0ab6576baae7aa7d05878b4faf36304ab76e4c6cff61a515321798b7806bbd3ad1f41c3e9f56fd15f519ff5218df8339272fe894008d9e6daf28438bc0777c5b4d1ff253ee97da3d2b055c01a6d8e9faf5b46f9a706486560549aada02ca2a9af662d5af50d1959f927eb389eadfd7395a1d06484d28e581fa6f924ef97655ad84a70bec7e6b8b179d81fe042ef62983f0597267706da108f887437d0f921330bcc62701bcfca7c4fb038e6ca19760d5a00323bb6457543319969d96de89ab9459dca742a54724468ba52814885255d85dbb2d73681b0d63e7ed71f22106028d2c537c4a616b4165b3131881c1c6b13881ab7367e932475dca928395677e1b6c2c6d6500f340d8185ec3ef25547793688c09a4ff280d90d526cb25f8cdae8a67e7ccf2300386e54039c0f6e30410f55e8d35bbdd6fa556b3ddf36fd0af2c7f6fb7fe94639c3367a9813b8d4c9d36cf9085a0da2d048a0c8230008da0874894951e027338a66f84bee43ff4fb7af6e497f12433deab3e2db1d36198d05f8ea373ffefb1946f0b22189eadf6f2fba0f166a0dd169efec7a614efe8f9dbc15b970b9c83f3cefc9db19ca431eab42b077e2c5ce199891178fc746b4e0f862120fe4ed4420d3fa924" + }, + { + "comment": "Bandersnatch_SHA-512_ELL2 - vector-5", + "sk": "da36359bf1bfd1694d3ed359e7340bd02a6a5e54827d94db1384df29f5bdd302", + "pk": "decb0151cbeb49f76f10419ab6a96242bdc87baac8a474e5161123de4304ac29", + "alpha": "42616e646572736e6174636820766563746f72", + "ad": "", + "h": "8af6936567d457e80f6715f403e20597c2ca58219974c3996a4e4414c3361635", + "gamma": "022abfa7670d5051a6a0e212467666abb955faafe7fe63446f50eb710383444c", + "beta": "126296afb914aa1225dfdddfe3bfd185b488801810e18034330b1c07409ccdc4f8deccfc30be219cb5186f80a523ae41720031ae39a78f18d3b14df8bb6d8e8a", + "blinding": "9c7ca3afb177b0fb13201336a0fd247260cd5a17764719c0167472b46248e309", + "proof_pk_com": "01322ca5d3c2fe5d5e3be35e75a7fe2b4c4aded43fe2a587c4b8c10ba28bea2a", + "proof_r": "18bd390f58af3ed31c2824e328d89f7ccb543f77a3e6c0fdedf3cc851da8a9e4", + "proof_ok": "3639790d6414b474aa1d53de4e7a896b4e6458c078867acd22200f00f20f280a", + "proof_s": "e0fd2d5a4adfe396072c22d22aa249da71b7a9576bcc5819b38d182e001d201c", + "proof_sb": "8a776d2c4999ae38d872b9e487dd2ce6ade338fcaa45e881fa33b2a686ec660f", + "ring_pks": "7b32d917d5aa771d493c47b0e096886827cd056c82dbdba19e60baa8b2c60313d3b1bdb321123449c6e89d310bc6b7f654315eb471c84778353ce08b951ad471561fdb0dcfb8bd443718b942f82fe717238cbcf8d12b8d22861c8a09a984a3c5decb0151cbeb49f76f10419ab6a96242bdc87baac8a474e5161123de4304ac294fd11f89c2a1aaefe856bb1c5d4a1fad73f4de5e41804ca2c17ba26d6e10050c86d06ee2c70da6cf2da2a828d8a9d8ef755ad6e580e838359a10accb086ae437ad6fdeda0dde0a57c51d3226b87e3795e6474393772da46101fd597fbd456c1b3f9dc0c4f67f207974123830c2d66988fb3fb44becbbba5a64143f376edc51d9", + "ring_proof": "8a14da0082db25f9b4cd7f7fc7f4e2055a194b459e8ef2870aa92977599649dfa7514d66760fae6c9143c28412760741914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114aa5dfe450a84fad9b8c57131e848e200df7281700f1b212a5598526810c43d6c637d3aa05080cb96db5d82cbf18106dc8917677a54b9e1d89947f3a4e8db97a5ef3f4fc358927a342096e4415640fb7019bfc250ec8b0cb8b32821361be082116c76d73ecd356a6a142f2745e533b3f4792502d54490b159cf4e4696c4927e93ce777e0c14a42cecf79dbc21b826502900bdeb8d45fe0eca979ed3a2722da2e0eae2166a498333ccb9599efad2bf4a2bab4689cc7fdd03404ab7dc5a57b89270d2bded0f6ad55e40d55c2cae704a5141460a3abf926a7f2246e379e1de17318232815b73e2d6f8c5331d0105bd3fd70f0f7a9895b334b6e1f7268ddf9c451f02afeee322b302a11da4266eacfc96edbe98fff5e6b27a03983a561a89fc1ac465bba12ff2d1a2378b29ddad3a76118baaebc2a93587d6910b4716c73b5a9a75053991db1ccd121e08f4a5644705177f00452abae07ecca6586e77c3799d0fa819d441bb73cee2585099e6c0354ca4afdd2a349b3e928263af9711d15624e10faae0c3ee38742821e7bec2bc1156bfc655ea819451d1a7cad09396562a3a0246f26716e5073c8fc861ace774571b456a6f8df02893adf26b3c0079d6c740be0ad03a4b9a980d1a3a3be7e57d8aa6972b70b96518868c8d5fbe11a310774f67bc7025608e202c026501b30062d55cbb7604b" + }, + { + "comment": "Bandersnatch_SHA-512_ELL2 - vector-6", + "sk": "da36359bf1bfd1694d3ed359e7340bd02a6a5e54827d94db1384df29f5bdd302", + "pk": "decb0151cbeb49f76f10419ab6a96242bdc87baac8a474e5161123de4304ac29", + "alpha": "42616e646572736e6174636820766563746f72", + "ad": "1f42", + "h": "8af6936567d457e80f6715f403e20597c2ca58219974c3996a4e4414c3361635", + "gamma": "022abfa7670d5051a6a0e212467666abb955faafe7fe63446f50eb710383444c", + "beta": "126296afb914aa1225dfdddfe3bfd185b488801810e18034330b1c07409ccdc4f8deccfc30be219cb5186f80a523ae41720031ae39a78f18d3b14df8bb6d8e8a", + "blinding": "45d9aea3b3bf467c037802e80ae7cb4a13b394b20fcde630c2af6605f58ea918", + "proof_pk_com": "9d16b8d865bec4eb09438eb0589de8d9bc3cd541fbcaa12861633fc548f677c9", + "proof_r": "5198746f79383326eb7edb7dcd579772451f42f2c73b35c20d162334dd7abebd", + "proof_ok": "3639790d6414b474aa1d53de4e7a896b4e6458c078867acd22200f00f20f280a", + "proof_s": "b19e0d4c7c61ad0667f60b2e51d2555139a0e511800f92c15ec44eee2a547005", + "proof_sb": "d06b4be651aa3f1858a391984413a12a83f04e5f54d794ead2d8088ccb2fbd14", + "ring_pks": "7b32d917d5aa771d493c47b0e096886827cd056c82dbdba19e60baa8b2c60313d3b1bdb321123449c6e89d310bc6b7f654315eb471c84778353ce08b951ad471561fdb0dcfb8bd443718b942f82fe717238cbcf8d12b8d22861c8a09a984a3c5decb0151cbeb49f76f10419ab6a96242bdc87baac8a474e5161123de4304ac294fd11f89c2a1aaefe856bb1c5d4a1fad73f4de5e41804ca2c17ba26d6e10050c86d06ee2c70da6cf2da2a828d8a9d8ef755ad6e580e838359a10accb086ae437ad6fdeda0dde0a57c51d3226b87e3795e6474393772da46101fd597fbd456c1b3f9dc0c4f67f207974123830c2d66988fb3fb44becbbba5a64143f376edc51d9", + "ring_proof": "85f6376cd2a106e36f5f7f6aecd41383130b329a44e3877ac7f47ba0e16c768a18c6d01261ce87a4921ba83ca240fdde914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114ab709c8b5066d9e0ac67bac7ea3bc03398fc195caf147550a69cf89d7355953358e9977691defc09034e5840819764bf0815abe91961b8728ab833a2510a1a072b151b82ac41d56e1b34760b2860ac7a50e78a907aaca47560907e8758af7dbdcf4d305a23d29788a219beccd16f5a8e979d6b84f5efe4cb45056e91d7e9a4f685804c155b7be8ebd68fdcaf2739c7a36a702100e27b77898cf19012a4ca0726f3ef79f80d9e914ca1069c034a263904c8a1be1efe2484d1000951fca88a8db20d4d91be59a083f6a21166c398dad66ebc792874c4b3165da73f9fa1de7a720290ddbb85b79bf74046b0a0db1b46e55be4e06ae6a72188a816cce32c586ee646878f0ae39a7833afbf55a9ab118e4ca4b58d64b4451bd1ff3b631728f0ed23d10f15586e0abcdc14b9b37bd3211b9ddc9bef1e4b0dd10cb70c9cb7f095c647000a39ba7e86b9c8b4f52d8a105390bd483829e7966988b91bf1961924c695d9d47487a147f57eb2cfbaeea6f34c020524ab7372449ab9fc8c2d717efb4a3036785ab6b2fa99e3b9fe49af48c5fa696e62aaf495c32ce25c4010e5776a0b50d3e97302255f417c8a8d89a66b637465e66c4b2f99530a8e0020d4617ee5733169c93b68621c4a56231503a1d0758dba335a66ae9e9ebc9da69ec46f897cfeb88bd887b172e47cd7059f1b394533c0b91236f" + }, + { + "comment": "Bandersnatch_SHA-512_ELL2 - vector-7", + "sk": "35b877a25c394512292b82bdf8468e98eaf03c79c7fc9d53546dadc5fb75b500", + "pk": "b0e1f208f9d6e5b310b92014ea7ef3011e649dab038804759f3766e01029d623", + "alpha": "42616e646572736e6174636820766563746f72", + "ad": "1f42", + "h": "69dec7fe79f816d095b04cead45e856ff6c7e798f513e09291958e35a5590443", + "gamma": "9adeacd15eacdc651e4db1ea4c0917973eac2000479edf6132f3774601cc6902", + "beta": "ff5f6324ea18bbb4df92f7d6304bf27a0a44fa80fd40b985de8d43963a7e02c6ef6f0947911604155c6fe40f68cc91c96ffd358275b58960554274498a70f144", + "blinding": "06c4062b0d1098ccf59ebf49c87add2deb9bd637b11ce833a4b0ab2f35306611", + "proof_pk_com": "406027b8138ca71cd3fae91c1f0493483a640ac47d90512257d2f081e59e259e", + "proof_r": "1382f1d6f4dc4c69b570c4c9ce1224af61e1dcd8d879731a57dd348e83dbb558", + "proof_ok": "b846dfbceb2a74fe102b3aec94e7b8460f5adcb609c407839ab6cb06d1e3bd38", + "proof_s": "ad87350848df54f79c16dae9b37d052b4906a1b5ffd83c00405ad8c548603c17", + "proof_sb": "f1cdde2944544cbc9de259348e76eda794ec757e8f2f5df719a8961e060c6f1c", + "ring_pks": "7b32d917d5aa771d493c47b0e096886827cd056c82dbdba19e60baa8b2c60313d3b1bdb321123449c6e89d310bc6b7f654315eb471c84778353ce08b951ad471561fdb0dcfb8bd443718b942f82fe717238cbcf8d12b8d22861c8a09a984a3c5b0e1f208f9d6e5b310b92014ea7ef3011e649dab038804759f3766e01029d6234fd11f89c2a1aaefe856bb1c5d4a1fad73f4de5e41804ca2c17ba26d6e10050c86d06ee2c70da6cf2da2a828d8a9d8ef755ad6e580e838359a10accb086ae437ad6fdeda0dde0a57c51d3226b87e3795e6474393772da46101fd597fbd456c1b3f9dc0c4f67f207974123830c2d66988fb3fb44becbbba5a64143f376edc51d9", + "ring_proof": "832ca489bb0e3c32c6d4b7ae6241e7fd37e12a4d05524f25df32b8499c87770ee77ed038beb6a29085d7aa56f46ad092914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114ab6a36c7819232eea91a65f49a0c194f4c745a876603239c06ac542fdccfa14296c2ece54522661f8e1e44bc2580c73a2b9231ddc157860244a021e8ac7714b6e77dc53247d9c1cadc606e420f54683b3c9c903488b6eba90e47f0f5a8845643ca1619b56d79814c8b7e3533523a5bee401dc5578082a2df093264cdd730f9e34f13c2e81d4170e8f645df3bc4725d043a43eaa6bc893eea3a7e328258de9125f3127c4461d33a7aaff79b799b88f38d19b63798f27adb29e13b670ccabe3d72675814633ac9760b7fa00a3d9b9461783cbef6610a4215e1db4c3f5985b3d463ec1be93f5806654e577b8a6ca4f2f720d2664ac4fa893bde3d7b2752b5afcf53b5b23d295cceff293c711eecef9fd02b11fec70df5c5c2ecb41d7bca6319b0b56d51fc5c3451c095726908090185ef7efdd683bc61df63ef5f668fa7a0452654f917b74e87ac4604e63f91daaab25e6479be11d6c0c6ec90570f6bc4dcf9000fc016cf5839822a514fdae8dac42ef3bcebe0062426aeaa9eed8d6617078f1910e0a4f6cce1acb127150dbfe8a34ee6238a0e8f685d1673dc59a0515ac0e9a03cb2fda159ef0aad43f9d631092d6b33b5032856e95ea3c2a83d9afe84d5781b0a688021b87dbf35e00e8bb68e5349d45f2eb3b76218ac0b012bb72923a33030b53d41846a55fd66e6bfbe28aa7bb96ea5a" + } +] \ No newline at end of file diff --git a/data/bandersnatch_sw_sha512_tai_pedersen_vectors.json b/data/bandersnatch_sw_sha512_tai_pedersen_vectors.json index e52c63a..ff29684 100644 --- a/data/bandersnatch_sw_sha512_tai_pedersen_vectors.json +++ b/data/bandersnatch_sw_sha512_tai_pedersen_vectors.json @@ -1,6 +1,6 @@ [ { - "comment": "Bandersnatch_SHA-512_TAI - vector-1", + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-1", "sk": "3d6406500d4009fdf2604546093665911e753f2213570a29521fd88bc30ede18", "pk": "fd72a90d1eeba6733824e76bb31991b8108d6562756b85f244333e3c7205225200", "alpha": "", @@ -16,7 +16,7 @@ "proof_sb": "6b2dbc4b088b21d732cc5193439b5186cddecb4ee12f8233cbe3057c06849216" }, { - "comment": "Bandersnatch_SHA-512_TAI - vector-2", + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-2", "sk": "8b9063872331dda4c3c282f7d813fb3c13e7339b7dc9635fdc764e32cc57cb15", "pk": "e30eae606d21dff460cdaecfc9bfcd2e319628ccc0242f3ca21f2d5c940ba41680", "alpha": "0a", @@ -32,7 +32,7 @@ "proof_sb": "f05d631c7ae9fbc33ea4464af81188c1342f7c6aa127531e1f1bd203d608f613" }, { - "comment": "Bandersnatch_SHA-512_TAI - vector-3", + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-3", "sk": "6db187202f69e627e432296ae1d0f166ae6ac3c1222585b6ceae80ea07670b14", "pk": "2a00e5a32e2f097858a1a4a73cf5c2fb4e6d375a4ea4cc3ae3e91660eade850c80", "alpha": "", @@ -48,7 +48,7 @@ "proof_sb": "07a177cf9a9d08282194c8cc0d856be3de2681c642ecd0cb95a014a82f7f5c11" }, { - "comment": "Bandersnatch_SHA-512_TAI - vector-4", + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-4", "sk": "b56cc204f1b6c2323709012cb16c72f3021035ce935fbe69b600a88d842c7407", "pk": "4f29d79a27b9545d7223431eb6a63776949454b16e2ac0b7a959304ce3e52b6a00", "alpha": "73616d706c65", @@ -64,7 +64,7 @@ "proof_sb": "5b4d6ef3445d8dc8bcc38f44b3649d39fcb5c0b169c5085245f6903ef8ba940c" }, { - "comment": "Bandersnatch_SHA-512_TAI - vector-5", + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-5", "sk": "da36359bf1bfd1694d3ed359e7340bd02a6a5e54827d94db1384df29f5bdd302", "pk": "e58e8ba2e99035fb7ae11fa14e2a609d6d13679278dac63ebee64ca8612ffa1480", "alpha": "42616e646572736e6174636820766563746f72", @@ -80,7 +80,7 @@ "proof_sb": "bd365d1ff09f59a9ad885bf3f71e81151747757788f6c07387f4100842784e13" }, { - "comment": "Bandersnatch_SHA-512_TAI - vector-6", + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-6", "sk": "da36359bf1bfd1694d3ed359e7340bd02a6a5e54827d94db1384df29f5bdd302", "pk": "e58e8ba2e99035fb7ae11fa14e2a609d6d13679278dac63ebee64ca8612ffa1480", "alpha": "42616e646572736e6174636820766563746f72", @@ -96,7 +96,7 @@ "proof_sb": "9e989c2ae5177ef9505705cc144116f0b633693ca4fcdb85ec9b073fa06afb08" }, { - "comment": "Bandersnatch_SHA-512_TAI - vector-7", + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-7", "sk": "35b877a25c394512292b82bdf8468e98eaf03c79c7fc9d53546dadc5fb75b500", "pk": "7cba529a807bf602c84625fff28f4d1d836cf40a83f42d95c412f7b62ed9192900", "alpha": "42616e646572736e6174636820766563746f72", diff --git a/data/bandersnatch_sw_sha512_tai_ring_vectors.json b/data/bandersnatch_sw_sha512_tai_ring_vectors.json new file mode 100644 index 0000000..00e376e --- /dev/null +++ b/data/bandersnatch_sw_sha512_tai_ring_vectors.json @@ -0,0 +1,128 @@ +[ + { + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-1", + "sk": "3d6406500d4009fdf2604546093665911e753f2213570a29521fd88bc30ede18", + "pk": "fd72a90d1eeba6733824e76bb31991b8108d6562756b85f244333e3c7205225200", + "alpha": "", + "ad": "", + "h": "8d57b4429fe0634284109950f71bfcf5aa44df39a2945a73d2101693962f974880", + "gamma": "12c6dbe75cfd299ab9c779b1a672dc94ba7c29df2c16bdd0b0d11cf622c7cf5d00", + "beta": "062651ca286b16ad24029fa900e50071d7a55ef897965b66b43b753f62bff6e84d63e9402982b058f44e4fdb6e242af33195d9f078670a75327a8b592f573ea0", + "blinding": "d4ebce35da8b4afd3abc8df5202ae83d279caca587a442881b47a601d4ed3a03", + "proof_pk_com": "ccf3e8955b80071d59602950f81eede3ec0778262f65c67c0d44977646412f6a00", + "proof_r": "1adf489b4d849c72702117b764a7f648b0fb8eab0b0698cbc5453afddd73886800", + "proof_ok": "b095103542abc9ec78ab52ee908f8af6971ae8f264c9a50c56c6f91541ec150980", + "proof_s": "bce7fd9b65379916cca77f243ac0071baa0e259816da8e0a96ac538ee657490a", + "proof_sb": "6b2dbc4b088b21d732cc5193439b5186cddecb4ee12f8233cbe3057c06849216", + "ring_pks": "c49043883ab2b5022e6b6050ab32b1b5fac32d8feac60ff5a2a0f300de3b027380df89abf403256d66b848ed97286997396ae4a36b4efb871cee426db00a31a73100361acf81e906a57a1b015afa7d755957597a187ef5b759f07ed49cfd0795036100fd72a90d1eeba6733824e76bb31991b8108d6562756b85f244333e3c7205225200e0d311f75e84c5ab6df5752b52be1d445d21f26b82736f1f7eb95a4ee2e3cd1480780fe2fc4cf2ade0c4a8b209ea790a7359bed1903c623d6c5a3e6fa14ef8cd4b00b2c0747a0e2e633055203066476aafee699e60c91500924c13910997f727670980d8bccfa3a9f11d7da69f44f8a50fae932c24172e1cf1cdf331abdf8777932d0400", + "ring_proof": "b331a1b39823e75febc03df0651e36d67b73a7f71d2ec2d210bde24387767c4c97ec36a4884aec3702ea91ad20fd330f914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114a82d1fb5408cc4451c814263d8fb18fc7deb974ecbfd1426b5b6ad1969f44f9bcbbd4065d6ec7b99b959ca3e404ae6bce99313bd224333d0afe7886a18c034b9a882ffbd03b0f40d2d2cdce60bd90aae7c03b7bbc76accb24f2b6aa015cd0d0b4fd17b24a07f59fc550bdd06dc2afcdddbf8b2a7ccd92242a8eea3b838aeb3a3326ad4f201febc21042b2d3980d0f399e63cdef24c69604f0b68a654d31de9555aec598fcd165b6d343d34a06be6f7132afd525c70fe2ab4b5496007e592b79661fb103b9731033f08f81dc2c4ed18c498d6aced00e1583d859e6037204eefa4284da9d3e45ab4aaf2bb27474ebf8d848c5b2ea40134e7744c84dbb3f805a1c28e25a83918511964bfcb0b7e75617595ab416f9de1d435f35f51dc2927c6b02299db57630dadd72615aa9d4953dc08f954bdb3050bec241b759ef35b4980ae2449268a2e88849d79c38eca8664a661b6a0460ffc73bc3a116878bb080f031babfb499323232bd2ccc4c78533da52de7727c84c762bb54d5a690b4fa53fdc4a96dd2cded4781b29f7cfaad08553ff3ed61af4916622d4aebb1455fdf291dcb57bbbc9772dfe03348e0a4f2d4f9b977235fad8110a10496a1b5a3930153ca0df803a619ae254bbb9b77afcd48f98a759a070dfeabc7dc4daf73530648b3121509ef9d38a3b384bcf68b9c3cc8d59c0a9594" + }, + { + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-2", + "sk": "8b9063872331dda4c3c282f7d813fb3c13e7339b7dc9635fdc764e32cc57cb15", + "pk": "e30eae606d21dff460cdaecfc9bfcd2e319628ccc0242f3ca21f2d5c940ba41680", + "alpha": "0a", + "ad": "", + "h": "57b75ca092f54aa6789b1e0ffd73dffa8dcb3281ddf28de713829a3c5a61213780", + "gamma": "c51ea125fd52dbcef599fe65913a0fab4d9381837252b6e2ce80b28c9d4f925380", + "beta": "a1c52b5286e2169069c56ddfc7b748fc9fafac1c761407bb8fdb95365d74eb1b6d4439518340ec08f4316ffae3ac7b45aefcbc94af96bce3b9df37fc62bf625c", + "blinding": "69002723fa17271ca2cb68bddc0626b51896960afa1c83b2b8f369e5b50e8a0a", + "proof_pk_com": "f7c733752174e44ecc0971c3e5df85e719a5487e2083c950e062fcdf4610586f00", + "proof_r": "114b873a714989690bc478f693f57e3c6931eaf5708520870e5d2fa48ad84b3800", + "proof_ok": "d3773503ac5557f7551930f6c14fd9f4d81eb8cc64a87271cd9860cc99a0db6380", + "proof_s": "99e5cadc5dc736153d9482e65c85bd4ee3e22b7060c428b77256753472c1fb17", + "proof_sb": "f05d631c7ae9fbc33ea4464af81188c1342f7c6aa127531e1f1bd203d608f613", + "ring_pks": "c49043883ab2b5022e6b6050ab32b1b5fac32d8feac60ff5a2a0f300de3b027380df89abf403256d66b848ed97286997396ae4a36b4efb871cee426db00a31a73100361acf81e906a57a1b015afa7d755957597a187ef5b759f07ed49cfd0795036100e30eae606d21dff460cdaecfc9bfcd2e319628ccc0242f3ca21f2d5c940ba41680e0d311f75e84c5ab6df5752b52be1d445d21f26b82736f1f7eb95a4ee2e3cd1480780fe2fc4cf2ade0c4a8b209ea790a7359bed1903c623d6c5a3e6fa14ef8cd4b00b2c0747a0e2e633055203066476aafee699e60c91500924c13910997f727670980d8bccfa3a9f11d7da69f44f8a50fae932c24172e1cf1cdf331abdf8777932d0400", + "ring_proof": "95860ac37075264c7e3773dbf5809f342aae5b3658cffaf9710214b208fe67c912b6bd0b3903eace64638afd2e769fb5914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114a836a0473bb265ae31e468eace62191971ba2de2d8475ef22d3b1e5c6e68065f86026c0ad331118342c8753a1017e0b0a83999275ac78aab2128685e5ba9930d3e665ffb05d7a76eb5bcea6d5485b33737906d55a6c34e39f8a04ac6ac8ac281649b9960a4b45521d5df2324e432631d6f51887f1534dba416619e8c653244162eb56f58a629ea2a1be7d2a2622d90ee7b40e481c56b6542d3013e84f19efb4602f6a645c0468e624c1bf5bceeacdf5734c86054fd89f49d748efc964ef4d7b202a8292a59a4c28c853af5275884aa9f457441db53b421526ab970624a8600a2226a3e28c180d92c3c1660bfc173e0ab8390a686ec8fdca5caab02271086c3500a5ef85cf7c90c5c570691a9d1e946c28aaad2eb0f0e3f107f6d4725862a08015571f304b5dca66bd89593a17cf83923804a89847854fbd1e230d8ae834092e17845627582d4a7b4cbe3e73a579b5de815c00e80f55861cef147c4ee765f977d480299c8576cfd41ffbd33c557f0b4d231b5f3aff08a7a2d67dcc399fb35412f0a72b3cd62552d6747763de6de768fc4c8a63604f3669e8d775d08c1f70e1508fc96fc709665a146e22cc0a5e009cebddfc53dd3a800b7680f4108751f3659473896976046d6d32739932285fe48186865bc67e73f2593a0f0bdc3a73cb9527eb8362e072ecafbf7b7369bcfc2b81f65c" + }, + { + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-3", + "sk": "6db187202f69e627e432296ae1d0f166ae6ac3c1222585b6ceae80ea07670b14", + "pk": "2a00e5a32e2f097858a1a4a73cf5c2fb4e6d375a4ea4cc3ae3e91660eade850c80", + "alpha": "", + "ad": "0b8c", + "h": "73366813edd2b2b55627f6b09f4ac0042001835532f8226c5868c2e8b468af1f80", + "gamma": "d00e55457f0f2c0e5ee0e6fb3647b1e07c25b3798eec707a26a63755dd03526e00", + "beta": "0bf0d62a49047260a821582a13d050dcd702f3b67eb7839839b70c07b9c24197d6286b1d4667228b8ddcbfe8e024327551b4d78f9b8f6a5a7aa820ed5a79d58d", + "blinding": "f64433af29f82a05f527867c26dbfb70efc6d6660e93ef47ac114dba297c4713", + "proof_pk_com": "73b8287eb92a955d17e993dbb3bf94584c2b02165ea0a622ed7a916b3add480e80", + "proof_r": "ced8368aa3d9c3da6db57aa087ba74986f7efd5b766100ee7298b58bf9f5843c80", + "proof_ok": "a0265bef71e318e27e293810a403053f4f3d322a58d406964d71f72a6b52e32600", + "proof_s": "701152ce19ff66fb5228051b39fa8bfe52ad2c49556dd9c82513d1071ede8d19", + "proof_sb": "07a177cf9a9d08282194c8cc0d856be3de2681c642ecd0cb95a014a82f7f5c11", + "ring_pks": "c49043883ab2b5022e6b6050ab32b1b5fac32d8feac60ff5a2a0f300de3b027380df89abf403256d66b848ed97286997396ae4a36b4efb871cee426db00a31a73100361acf81e906a57a1b015afa7d755957597a187ef5b759f07ed49cfd07950361002a00e5a32e2f097858a1a4a73cf5c2fb4e6d375a4ea4cc3ae3e91660eade850c80e0d311f75e84c5ab6df5752b52be1d445d21f26b82736f1f7eb95a4ee2e3cd1480780fe2fc4cf2ade0c4a8b209ea790a7359bed1903c623d6c5a3e6fa14ef8cd4b00b2c0747a0e2e633055203066476aafee699e60c91500924c13910997f727670980d8bccfa3a9f11d7da69f44f8a50fae932c24172e1cf1cdf331abdf8777932d0400", + "ring_proof": "8d955f81941804cf459e90d47f8ad52dad412f0a761ca6627f2e3ebdfba90c05a4e7cfae96a456f48a1f6a3d08c82d70914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114ab210c96b48d5db8c29e82ccafe384dad46d844a60637eeb1068530015e2f83a1bbd0c42397f26d0df5057f5dab33ebb2ac264ba32868d7ddecbde92f5d28073ffa1503e963c449d8b54e93a6155142b66093c2f55c6eaa8cbf0061702b2caf01b6e057fcd5566d0ebdf48bc8ec861ab565512c52d73c5b7a629c73f4b1829c098df52af02ca2b16fb4de927a1341b112ec42780206d5daba23622dda667dff585bac8717846b1b2cb7ef48ea83283ec7037d8436f341b94cd7858b3590626d57bcd2ea176e5b1749126d7a243d475f3d3a12b5950637f17a26fa92573109491bc53e9184c053d58d71608c4a9314ec520b51e5622d711f3c9b0861b9c636af0158d0a2cda7221946049b9960d92f4bcdafcd968e5ea93f150d6fac925e5a263cdfe6e2a932321508869ef7da1222a455b08ce815641b9727b8e0c867e7dae24a8973caeb2a706944c7e837f3a701f7d1c9f779a5f0a58cecaf7dd40ae3dca6d881e4e7ae733d0b17993844e5f3aef4a6524e4c60734fecdf27f8eca8e10f64165fa60bfb21605b66072cdbd01e73d52082f53b32e0ed541c889c4ad226ec77aa6cf05f52fa228fe04f7d2628b6f122c9fcb1f811baf00975954115c112187ffbb21cf6b5471df29bd02dbd0eb19b881ea41622f6e48d1f371b8d225015042572d3a6988f2b9bde1a97ff9eb0a0baeef1" + }, + { + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-4", + "sk": "b56cc204f1b6c2323709012cb16c72f3021035ce935fbe69b600a88d842c7407", + "pk": "4f29d79a27b9545d7223431eb6a63776949454b16e2ac0b7a959304ce3e52b6a00", + "alpha": "73616d706c65", + "ad": "", + "h": "2332dfac3969513b9ff5591ac0ee41fdf75072506e8d1af46d17dcc47436af6880", + "gamma": "d4e5ba74dc2c2bb92b99dca063601e07a9ace5f80b9ec295c8384c99b42dc75c80", + "beta": "ae953cf4b1101ee665106cc9a70a4eee06dc2ad6ad918230cd9cf56d94a17ec30863174b87507b80a5ee820e4fee8399047a23ad1c5d43e570d97ac95cfca421", + "blinding": "3bea53c66b765146febd667cc4f438c27acbfa8feca8b096f38ebe8ac0157f09", + "proof_pk_com": "7c0b524a06908a68a34d6794e7b88b599a7b596f4972cef6df4fe7f247d9392380", + "proof_r": "0d807b1aaf172cd0a4db0cbd60705edafd0da02518ff9740ca31a9637a473e4700", + "proof_ok": "082084d4130c2c573ce2aa2832da054bba21b484daac99d59b91a92d29f0680100", + "proof_s": "1357ba5172e62dee2038ede9e6b0ba25ccf5b035323c6956c5c1b725df8fd00a", + "proof_sb": "5b4d6ef3445d8dc8bcc38f44b3649d39fcb5c0b169c5085245f6903ef8ba940c", + "ring_pks": "c49043883ab2b5022e6b6050ab32b1b5fac32d8feac60ff5a2a0f300de3b027380df89abf403256d66b848ed97286997396ae4a36b4efb871cee426db00a31a73100361acf81e906a57a1b015afa7d755957597a187ef5b759f07ed49cfd07950361004f29d79a27b9545d7223431eb6a63776949454b16e2ac0b7a959304ce3e52b6a00e0d311f75e84c5ab6df5752b52be1d445d21f26b82736f1f7eb95a4ee2e3cd1480780fe2fc4cf2ade0c4a8b209ea790a7359bed1903c623d6c5a3e6fa14ef8cd4b00b2c0747a0e2e633055203066476aafee699e60c91500924c13910997f727670980d8bccfa3a9f11d7da69f44f8a50fae932c24172e1cf1cdf331abdf8777932d0400", + "ring_proof": "949266ce3b35411f16ffad99a971da627275a2ccfab6afae2bb4e5558c65d3f8fc85d53e14f7007db9cce630a9595fc1914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114ab6b23f34f8b144a53617ff5919e432592ff678e1310fe187af48d6e725de2affc479ac22e20f9a791c8af7683c5bf9388bf610cb150f47679ce6c50a1369c7c65b62700ca1a99327c6bb8aaa4556f30a5a1535806ad404c5f4c20b4413b585f18c9184c1d48b51ad07714b947283529a8aca38fe3cdf4fdbcb39389f00ac184bc27615c387a8ee81441947bd92ec15509229c2dfc33c995f39b13825bb696872e35c452efc69b8b8945fa12f1246eca0b248f061e40ecd0858e0dba945c8fe402510cb331882e23b1361557c28839f4ae1070e7ad7b2f233779e8654d9361104d6c43bf27ea0e164285a8939f9ee27caa93382af167cfe1f88406f471bc94652c859029d4a03b93076ad7515ee485cc6744c400336f91114d8e6a8715d2f531a9628314bf6e3bd69ec64bfcf1bb36eef71889ceaa1ef47474c2c22ab76a19c38809acd4203c7b7bf12e45326aab1921463d9b02498c57cea352476acfd2e2f6d7400c6a4c2cf559346092b718a255482d28db90b6f9e1ce227132ca47efb208e41aeb9759c18754670db8d8d9966bc638b0b3eea536b3b7eeee31d16c12d27dd69a397d2eced05fb8ebb54c56f7eeb176c64f32297d69ae5951f3c27114ff09aafe438b43d8a0202a726e55acb6762fb017b2e190cf9ea718a1524fa6ebdead21c951b945c071d66d1a99c6b78d20071" + }, + { + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-5", + "sk": "da36359bf1bfd1694d3ed359e7340bd02a6a5e54827d94db1384df29f5bdd302", + "pk": "e58e8ba2e99035fb7ae11fa14e2a609d6d13679278dac63ebee64ca8612ffa1480", + "alpha": "42616e646572736e6174636820766563746f72", + "ad": "", + "h": "dc4276ab164a69cc584b2b8fd3da54531649e075ca2e26688eece1ca9fdc230680", + "gamma": "aacbf066133024064dd8923da69ae3fc52b2fb8b2b1a2508621472392e99e00b80", + "beta": "a67a122a8423aabb806342b4b3f8f652de250acf964339d8975f07052015ca993b97a96cfc07ed2f07bc8b596eb88f561724d376f25846337af88edf5c86f602", + "blinding": "a10f2fb07c1cca2f296ecb891f85c494b3db763312da0a20c94ccfdb0dcd150c", + "proof_pk_com": "5b24b1e4d591dfe88660692444f87cd4230dfffc24781bc87b09311c02aeca0580", + "proof_r": "9970a469ef2ccbd5d6bf7689d537498fca049bc94e909de8010fa6258f19a10400", + "proof_ok": "6d63a2b05cc3a230a6a02b89c63c2a4daa13cccbd73e82960813d65a2d0d5b0580", + "proof_s": "6f5e9d3b17ac3473e49d518c7d8ec17ceb72f4a7efa474112d022841939ef009", + "proof_sb": "bd365d1ff09f59a9ad885bf3f71e81151747757788f6c07387f4100842784e13", + "ring_pks": "c49043883ab2b5022e6b6050ab32b1b5fac32d8feac60ff5a2a0f300de3b027380df89abf403256d66b848ed97286997396ae4a36b4efb871cee426db00a31a73100361acf81e906a57a1b015afa7d755957597a187ef5b759f07ed49cfd0795036100e58e8ba2e99035fb7ae11fa14e2a609d6d13679278dac63ebee64ca8612ffa1480e0d311f75e84c5ab6df5752b52be1d445d21f26b82736f1f7eb95a4ee2e3cd1480780fe2fc4cf2ade0c4a8b209ea790a7359bed1903c623d6c5a3e6fa14ef8cd4b00b2c0747a0e2e633055203066476aafee699e60c91500924c13910997f727670980d8bccfa3a9f11d7da69f44f8a50fae932c24172e1cf1cdf331abdf8777932d0400", + "ring_proof": "b3d39b50d3cfa3ffd9c036cdbce079ff2efe683d0a21068f0a5aae24241f3e2c8ff5a1371996c093fc1aeab7bff9e645914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114a83ef80bf9dbc811cb93f63d53e3cd86fe00ed36de9c8c70ad4af4dbebecb34d35b5dff5ae51b8bcf75bcdca6c687700ab755ff222e2e97fcb8e1b868d839d8b0077aff4fc3284d02f6f7f6a3cb7809be18d96ca288dd757a0f3301673b1d669db0f8999c01f86ed9f9fa3742e3f64096cfb45f16d3e06076016470830537680f245e0fb2f2cc313274983885ea2444e1c67237d3c10b1642273fcf715a68c06f8078fdd7d0e214bd626064e09a2b2f8d18891ce3cc72f79978fc9533e844bc5bf2a39d21c80119061fd84de54039aa7c30c78d560ebcf6e7142667aad762872efc93bfca70ecc5da425489c7bd9fe090bd31f0caa16ee9646cc0fbdcba3f1f25c71ce83c00405a1296b318e82fd1389b3abe4b2681f6905b1a774e11f91d3b4808595e4ae2816e4ede8b8190c4e2cd86b195a8df36c0f3803b780e59072eb75ab5dd73ca49891292f8c9746b659817fc765405f1f93f055302d5cd7017813a0ba4d501f890e4c3d7dc4e758ffb76ad50e0477c5cd45149ae5e3e174720c195b7f09fa61f03430d72f75297a77a8afb0cb6bcb3b186a47bf0cb7ff85be92d028bfb536d918fafb8f1642e79c388a9b150b595e01293d6bf5c9f59c1437868b1f7a937148bddd9d685e13664a763b6e0aba53c49000d6ea879e151906a613fd8e3a45604d0162270776992044509402132" + }, + { + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-6", + "sk": "da36359bf1bfd1694d3ed359e7340bd02a6a5e54827d94db1384df29f5bdd302", + "pk": "e58e8ba2e99035fb7ae11fa14e2a609d6d13679278dac63ebee64ca8612ffa1480", + "alpha": "42616e646572736e6174636820766563746f72", + "ad": "1f42", + "h": "dc4276ab164a69cc584b2b8fd3da54531649e075ca2e26688eece1ca9fdc230680", + "gamma": "aacbf066133024064dd8923da69ae3fc52b2fb8b2b1a2508621472392e99e00b80", + "beta": "a67a122a8423aabb806342b4b3f8f652de250acf964339d8975f07052015ca993b97a96cfc07ed2f07bc8b596eb88f561724d376f25846337af88edf5c86f602", + "blinding": "74098dbea4d66e30b6862b360e89979c5c1774d80c802a2053e84cf9e72d460b", + "proof_pk_com": "6f16a328f465a90c3b9915b8150642b4cd251e6d659f86cb52337b9e825d260a80", + "proof_r": "d3eb2cc87339c8ca466be14b14f8cef934428ba2dd182899a654fce85bd0833480", + "proof_ok": "6d63a2b05cc3a230a6a02b89c63c2a4daa13cccbd73e82960813d65a2d0d5b0580", + "proof_s": "12f8a97cf8ddf1361c247e51d0876fa93425706e21e1403ca6b430a4b7ad1708", + "proof_sb": "9e989c2ae5177ef9505705cc144116f0b633693ca4fcdb85ec9b073fa06afb08", + "ring_pks": "c49043883ab2b5022e6b6050ab32b1b5fac32d8feac60ff5a2a0f300de3b027380df89abf403256d66b848ed97286997396ae4a36b4efb871cee426db00a31a73100361acf81e906a57a1b015afa7d755957597a187ef5b759f07ed49cfd0795036100e58e8ba2e99035fb7ae11fa14e2a609d6d13679278dac63ebee64ca8612ffa1480e0d311f75e84c5ab6df5752b52be1d445d21f26b82736f1f7eb95a4ee2e3cd1480780fe2fc4cf2ade0c4a8b209ea790a7359bed1903c623d6c5a3e6fa14ef8cd4b00b2c0747a0e2e633055203066476aafee699e60c91500924c13910997f727670980d8bccfa3a9f11d7da69f44f8a50fae932c24172e1cf1cdf331abdf8777932d0400", + "ring_proof": "b40805c9a99b39612f357e999789676cec5035f1da3f7f33697eacee5575a04e2b04a3d9b1546c32a92bb61026311aa0914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114ab251d846eb0703fef7155a49f62a0373a9970d212e460b6f599c99bd3dedff94d1f0173db8cad36f7963c4bd87663bc38103d6709fed14e51d8c0f8a6ac2fa9749066fbf8c7adfcf5e9a6a499cdbe14f2a3ade1d2f0bff4d077c00991b195bf9fd8e4ae22e4b474d3ac7c8ad454432893fc2e5bb18670099d2376e3cbe217b1de882520304f663e3f21e6beccaecb3148c3daf78bfd481f78bca6d97e3c2b05cc6ea7ccf006f0787282ae1f431f2f20baa264e80e84b6053805ac86f43fde443aec6a3f36d5d1744cd12a146856c359b061a6152d77ef767a5d28f24bec95c4aa606bb884eac9478122f3176428f848a0c3fc2566280e730f9c0d1422c8ceb5fcc4fe45d20d51a89793d29b15dd53b517256c2b9116666ae4ed6f996a9e360426d97ded1c42432d082d19fc48cf42f3d60335bf95134193e9d3a63fdb8275c53a1215606b80f043b10fc3212669963d8624cdc19fc8663335930a18820139cc569444329198530f62e45dd860ecce11308ffca8519b2dbc1e408165d796cb8f394634cf3df3402c750ba6ffcb7f3441984a44ef8e9f624afea10ca9c0ec211e9a3c0d9533321cfae44d41c98e8633566bc9557e01fcacf0eed4901a7cccea7d789b3cb1ae42db197df93ba26459f9bfcf5e4e36dad3bc13aaef78d4d78f6c12e5062b00f017f0c9a8f30879385d651c6" + }, + { + "comment": "Bandersnatch_SW_SHA-512_TAI - vector-7", + "sk": "35b877a25c394512292b82bdf8468e98eaf03c79c7fc9d53546dadc5fb75b500", + "pk": "7cba529a807bf602c84625fff28f4d1d836cf40a83f42d95c412f7b62ed9192900", + "alpha": "42616e646572736e6174636820766563746f72", + "ad": "1f42", + "h": "19dabe58c814c1fda846486816d25c20c5c8e5e8436faeb868be4faa72a2075300", + "gamma": "22579292eb93fe045c54c19abb0a7e0fd50c87b33c3f70f1b4a2e4be3d603b1980", + "beta": "d10d879d35a898ba56ad092812be75a4ea272480cd9adceb4886806d31672b543b91adaeba27769917a024de221446a793ce84f1f628a091236c0b02a3be8585", + "blinding": "2d0a4f20991a989fad34418143ed442e5b7ebfa28557a1af3ca4f773fe6d3404", + "proof_pk_com": "4c527073bc489fc9ddf51dea1f42e0784f91634ab7cf9f604548a5f590e0361580", + "proof_r": "21bd98821f3e2d3988e9a07410c05fc42ce710f01429772d377f7da03ec7d12d80", + "proof_ok": "26c0818e2e3fdc5b7d70aa0c8c17c521423cf82e805fed9f760c253d2d55d64a80", + "proof_s": "535def09f9b0c90b19968613a0510b6e927f19c7ebce065a6a9ce5e884031d07", + "proof_sb": "544d6c05b7deac50e2950e4ea6ea6ae6e64dc618360ec60384c6d7c395264706", + "ring_pks": "c49043883ab2b5022e6b6050ab32b1b5fac32d8feac60ff5a2a0f300de3b027380df89abf403256d66b848ed97286997396ae4a36b4efb871cee426db00a31a73100361acf81e906a57a1b015afa7d755957597a187ef5b759f07ed49cfd07950361007cba529a807bf602c84625fff28f4d1d836cf40a83f42d95c412f7b62ed9192900e0d311f75e84c5ab6df5752b52be1d445d21f26b82736f1f7eb95a4ee2e3cd1480780fe2fc4cf2ade0c4a8b209ea790a7359bed1903c623d6c5a3e6fa14ef8cd4b00b2c0747a0e2e633055203066476aafee699e60c91500924c13910997f727670980d8bccfa3a9f11d7da69f44f8a50fae932c24172e1cf1cdf331abdf8777932d0400", + "ring_proof": "896631a58189555420eda5e92bce2354f8ac40c7ecb9fda9a22903bd5ca118ea9147a4e68a77f30d46d1dd7b0b2d770a914ad8aba8c1092777dfb212803dfd389c0e3b1678c6e5e0bf02c3c8179537ca205bb3580e43016ccb584c0c08b1114aaab50e151c90fca8f4291013937068aeee9823cc525a0a0814a190bf6ed881753053ef22c835f46d6b8310738691ffe598db8ff8c032000c8b1b19cd29e540d0356b55fc028b16e9de7a3aeabd7dd509e7d34de280f81cceb1d78073b99e56e6df04bff6226f734f1bb537a19c215479f6238a5541e2f2c5a997ad41367e26687ea818ab94057122fd92e6c2f523703278f4f10bbf52310c6cac8847d03065569e43e87c6d3b09cedd218e74df013884d0cfcf31a63b66cfcfdb425d7bd70b21019ffce253c1a9b70f73dd1090b5c819925a0a70bf9f3a69f33169147dc52e4fada092230ecfef73b9a63c1d092af6288a6b9373fe2c0b4138817d4b8015d25f137ad7e63a708b3d7cf180591150c949f54baf08d98448f3bb94d15a46b234131256ea5d837a92ec2a2fda5f54e7f43623851dd67ade9b51997c3ac7e4b2987287bcba6cb1846ef1aed96b172be2bc8460653e2f479d8c391aa3b2f0f73cdf06cc24ce49933316ed04e4caccbdbc07f2b51ac914e195ede61ee88333bcee5a420b3b2a940c782b991f2dbad93431db1e979ebf0eba30fa638e7afa546327867d1d27b65dfe3202866e02a519d95d29d25e53a148a5da77bf104b855f5de81db3b8ccacccdf6fd7fa632b92542b9de202a85b3e8c1b36c86f61bf99daf60de1f212a80994c7fde00804ed13172817024f" + } +] \ No newline at end of file diff --git a/data/zcash-bls12-381-srs-2-11-uncompressed.bin b/data/zcash-bls12-381-srs-2-11-uncompressed.bin new file mode 100644 index 0000000..2cb8c31 Binary files /dev/null and b/data/zcash-bls12-381-srs-2-11-uncompressed.bin differ diff --git a/src/ring.rs b/src/ring.rs index 8a993ff..28937ef 100644 --- a/src/ring.rs +++ b/src/ring.rs @@ -309,7 +309,9 @@ where #[cfg(test)] pub(crate) mod testing { use super::*; - use crate::testing::*; + use crate::{pedersen, testing as common}; + + pub const TEST_RING_SIZE: usize = 8; pub fn prove_verify() where @@ -318,17 +320,17 @@ pub(crate) mod testing { AffinePoint: utils::te_sw_map::SWMapping>, { let rng = &mut ark_std::test_rng(); - let ring_ctx = RingContext::::from_rand(512, rng); + let ring_ctx = RingContext::::from_rand(TEST_RING_SIZE, rng); - let secret = Secret::::from_seed(TEST_SEED); + let secret = Secret::::from_seed(common::TEST_SEED); let public = secret.public(); - let input = Input::from(random_val(Some(rng))); + let input = Input::from(common::random_val(Some(rng))); let output = secret.output(input); let ring_size = ring_ctx.max_ring_size(); let prover_idx = 3; - let mut pks = random_vec::>(ring_size, Some(rng)); + let mut pks = common::random_vec::>(ring_size, Some(rng)); pks[prover_idx] = public.0; let prover_key = ring_ctx.prover_key(&pks); @@ -370,4 +372,167 @@ pub(crate) mod testing { }; ($suite:ident, false) => {}; } + + pub trait RingSuiteExt: RingSuite + where + BaseField: ark_ff::PrimeField, + CurveConfig: SWCurveConfig + Clone, + AffinePoint: SWMapping>, + { + fn ring_context() -> &'static RingContext; + } + + pub struct TestVector + where + BaseField: ark_ff::PrimeField, + CurveConfig: SWCurveConfig + Clone, + AffinePoint: SWMapping>, + { + pub pedersen: pedersen::testing::TestVector, + pub ring_pks: Box<[AffinePoint; TEST_RING_SIZE]>, + pub ring_proof: RingProof, + } + + impl core::fmt::Debug for TestVector + where + BaseField: ark_ff::PrimeField, + CurveConfig: SWCurveConfig + Clone, + AffinePoint: SWMapping>, + { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + f.debug_struct("TestVector") + .field("pedersen", &self.pedersen) + .field("ring_proof", &"...") + .finish() + } + } + + impl common::TestVectorTrait for TestVector + where + BaseField: ark_ff::PrimeField, + CurveConfig: SWCurveConfig + Clone, + AffinePoint: SWMapping>, + { + fn new(comment: &str, seed: &[u8], alpha: &[u8], salt: Option<&[u8]>, ad: &[u8]) -> Self { + use super::Prover; + let pedersen = pedersen::testing::TestVector::new(comment, seed, alpha, salt, ad); + + let secret = Secret::::from_scalar(pedersen.base.sk); + let public = secret.public(); + + let input = Input::::from(pedersen.base.h); + let output = Output::from(pedersen.base.gamma); + + let ring_ctx = ::ring_context(); + + use ark_std::rand::SeedableRng; + let rng = &mut rand_chacha::ChaCha20Rng::from_seed([0x11; 32]); + let prover_idx = 3; + let mut ring_pks = common::random_vec::>(TEST_RING_SIZE, Some(rng)); + ring_pks[prover_idx] = public.0; + + let prover_key = ring_ctx.prover_key(&ring_pks); + let prover = ring_ctx.prover(prover_key, prover_idx); + let proof = secret.prove(input, output, ad, &prover); + + { + // Just in case... + let mut p = (Vec::new(), Vec::new()); + pedersen.proof.serialize_compressed(&mut p.0).unwrap(); + proof.pedersen_proof.serialize_compressed(&mut p.1).unwrap(); + assert_eq!(p.0, p.1); + } + + // TODO: also dump the verifier pks commitmet + Self { + pedersen, + ring_pks: crate::testing::vec_to_array(ring_pks).unwrap(), + ring_proof: proof.ring_proof, + } + } + + fn from_map(map: &common::TestVectorMap) -> Self { + let pedersen = pedersen::testing::TestVector::from_map(map); + + let ring_pks_raw = map.item_bytes("ring_pks"); + let ring_pks = + <[AffinePoint; TEST_RING_SIZE]>::deserialize_compressed(&ring_pks_raw[..]) + .map(Box::new) + .unwrap(); + + let ring_proof_raw = map.item_bytes("ring_proof"); + let ring_proof = RingProof::::deserialize_compressed(&ring_proof_raw[..]).unwrap(); + + Self { + pedersen, + ring_pks, + ring_proof, + } + } + + fn to_map(&self) -> common::TestVectorMap { + let mut map = self.pedersen.to_map(); + + let mut ring_pks_raw = Vec::new(); + self.ring_pks + .serialize_compressed(&mut ring_pks_raw) + .unwrap(); + let ring_pks_hex = hex::encode(ring_pks_raw); + map.0.insert("ring_pks".to_string(), ring_pks_hex); + + let mut ring_proof_raw = Vec::new(); + self.ring_proof + .serialize_compressed(&mut ring_proof_raw) + .unwrap(); + let ring_proof_hex = hex::encode(ring_proof_raw); + map.0.insert("ring_proof".to_string(), ring_proof_hex); + + map + } + + fn run(&self) { + self.pedersen.run(); + + let input = Input::::from(self.pedersen.base.h); + let output = Output::from(self.pedersen.base.gamma); + let secret = Secret::from_scalar(self.pedersen.base.sk); + let public = secret.public(); + assert_eq!(public.0, self.pedersen.base.pk); + + let ring_ctx = ::ring_context(); + + let ring_pks = &*self.ring_pks; + let prover_idx = ring_pks.iter().position(|&pk| pk == public.0).unwrap(); + + let prover_key = ring_ctx.prover_key(ring_pks); + let prover = ring_ctx.prover(prover_key, prover_idx); + + let verifier_key = ring_ctx.verifier_key(ring_pks); + let verifier = ring_ctx.verifier(verifier_key); + + let proof = secret.prove(input, output, &self.pedersen.base.ad, &prover); + + { + // Check if Pedersen proof matches + let mut p = (Vec::new(), Vec::new()); + self.pedersen.proof.serialize_compressed(&mut p.0).unwrap(); + proof.pedersen_proof.serialize_compressed(&mut p.1).unwrap(); + assert_eq!(p.0, p.1); + } + + // TODO + #[cfg(feature = "test-vectors")] + { + // Check if Ring proof matches + let mut p = (Vec::new(), Vec::new()); + self.ring_proof.serialize_compressed(&mut p.0).unwrap(); + proof.ring_proof.serialize_compressed(&mut p.1).unwrap(); + assert_eq!(p.0, p.1); + } + + assert!( + Public::verify(input, output, &self.pedersen.base.ad, &proof, &verifier).is_ok() + ); + } + } } diff --git a/src/suites/bandersnatch.rs b/src/suites/bandersnatch.rs index 889824f..239f82f 100644 --- a/src/suites/bandersnatch.rs +++ b/src/suites/bandersnatch.rs @@ -293,6 +293,47 @@ mod test_vectors_pedersen_ed { } } +#[cfg(all(test, feature = "ring"))] +mod test_vectors_ring_ed { + use super::edwards::*; + use crate::testing; + + type V = crate::ring::testing::TestVector; + + const TEST_VECTORS_FILE: &str = concat!( + env!("CARGO_MANIFEST_DIR"), + "/data/bandersnatch_ed_sha512_ell2_ring_vectors.json" + ); + + impl crate::ring::testing::RingSuiteExt for BandersnatchSha512Ell2 { + fn ring_context() -> &'static RingContext { + use ark_serialize::CanonicalDeserialize; + use std::sync::OnceLock; + static RING_CTX: OnceLock = OnceLock::new(); + RING_CTX.get_or_init(|| { + use std::{fs::File, io::Read}; + let mut file = File::open(crate::testing::PCS_SRS_FILE).unwrap(); + let mut buf = Vec::new(); + file.read_to_end(&mut buf).unwrap(); + let pcs_params = + PcsParams::deserialize_uncompressed_unchecked(&mut &buf[..]).unwrap(); + RingContext::from_srs(crate::ring::testing::TEST_RING_SIZE, pcs_params).unwrap() + }) + } + } + + #[test] + #[ignore = "test vectors generator"] + fn generate() { + testing::test_vectors_generate::(TEST_VECTORS_FILE, "Bandersnatch_SHA-512_ELL2"); + } + + #[test] + fn process() { + testing::test_vectors_process::(TEST_VECTORS_FILE); + } +} + #[cfg(test)] mod test_vectors_ietf_sw { use super::weierstrass::*; @@ -332,7 +373,48 @@ mod test_vectors_pedersen_sw { #[test] #[ignore = "test vectors generator"] fn generate() { - testing::test_vectors_generate::(TEST_VECTORS_FILE, "Bandersnatch_SHA-512_TAI"); + testing::test_vectors_generate::(TEST_VECTORS_FILE, "Bandersnatch_SW_SHA-512_TAI"); + } + + #[test] + fn process() { + testing::test_vectors_process::(TEST_VECTORS_FILE); + } +} + +#[cfg(all(test, feature = "ring"))] +mod test_vectors_ring_sw { + use super::weierstrass::*; + use crate::testing; + + type V = crate::ring::testing::TestVector; + + const TEST_VECTORS_FILE: &str = concat!( + env!("CARGO_MANIFEST_DIR"), + "/data/bandersnatch_sw_sha512_tai_ring_vectors.json" + ); + + impl crate::ring::testing::RingSuiteExt for BandersnatchSha512Tai { + fn ring_context() -> &'static RingContext { + use ark_serialize::CanonicalDeserialize; + use std::sync::OnceLock; + static RING_CTX: OnceLock = OnceLock::new(); + RING_CTX.get_or_init(|| { + use std::{fs::File, io::Read}; + let mut file = File::open(crate::testing::PCS_SRS_FILE).unwrap(); + let mut buf = Vec::new(); + file.read_to_end(&mut buf).unwrap(); + let pcs_params = + PcsParams::deserialize_uncompressed_unchecked(&mut &buf[..]).unwrap(); + RingContext::from_srs(crate::ring::testing::TEST_RING_SIZE, pcs_params).unwrap() + }) + } + } + + #[test] + #[ignore = "test vectors generator"] + fn generate() { + testing::test_vectors_generate::(TEST_VECTORS_FILE, "Bandersnatch_SW_SHA-512_TAI"); } #[test] diff --git a/src/testing.rs b/src/testing.rs index 48db04a..929e333 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -7,6 +7,12 @@ use ark_std::{rand::RngCore, UniformRand}; pub const TEST_SEED: &[u8] = b"seed"; +// Zcash SRS file derived from (https://zfnd.org/conclusion-of-the-powers-of-tau-ceremony). +pub const PCS_SRS_FILE: &str = concat!( + env!("CARGO_MANIFEST_DIR"), + "/data/zcash-bls12-381-srs-2-11-uncompressed.bin" +); + /// Generate a vector of random values. pub fn random_vec(n: usize, rng: Option<&mut dyn RngCore>) -> Vec { let mut local_rng = ark_std::test_rng(); @@ -21,6 +27,16 @@ pub fn random_val(rng: Option<&mut dyn RngCore>) -> T { T::rand(rng) } +pub fn vec_to_array(v: Vec) -> Option> { + if v.len() != N { + return None; + } + // Safe because we checked the length + let boxed_slice = v.into_boxed_slice(); + let boxed_array = boxed_slice.try_into().unwrap(); + Some(boxed_array) +} + #[macro_export] macro_rules! suite_tests { ($suite:ident, $build_ring:ident) => {