Skip to content

Instantly share code, notes, and snippets.

View ECMUL outputs
0000000000000000000000000000000001e4a522a7be6787a1ca3f4e73886d942d7361d503f16d3fe2b9017d4d15c37aeaea936738f0841f1d0ae784a0d9165000000000000000000000000000000000022ce79b84d8a50924f451710b714f8c9d86de3788bcbb0b3029a6403eafaba4f2bd3f7ba8d84d6fd27faf3c39b573b10000000000000000000000000000000013dd624e47e3c47a9ba1933d4573a472d94652f334097ff22ae629d5e34bba4d22b80abc05ec99c5203642940c21326b0000000000000000000000000000000009d1bc2c73e184badadbe2ac933cd0f8cb8bc4eef8adb7144b79f3d26689674c970a835688e056704586c907e5a9deea
000000000000000000000000000000000b0ffb3d922e942651ca1f0c689aafab13ebc7159c9d17185bb5b6f411032c1f2bcb2be8d3c4c6e0b5aa15360ddeb4420000000000000000000000000000000014f89dd5725a4fd53375104ee4a3ec8320339ac66cd5d93c191d00bee0c2a462398f453730a739df0c97552b5db2b407000000000000000000000000000000000fc1bd3efd28b6889b0a561fff5480cff741a6f8853a27f22ecc0d1c40b1bf1544217535977de7cfa80a0c9389099c900000000000000000000000000000000015260854c0605d1eb28a70ece440d53257be84d7e9e7bab96daf54e8c99471409ba6635e7ab96082e367ad2e3aa6ecb
View ECMUL vectors
0000000000000000000000000000000019f05bdd1f5a951019cbd9cad542760e3b04dd668d82a6f1a08c51798f0928ff6bf80169ee164c93a1aa1fd46ffc467e000000000000000000000000000000000a9c756b03fccc5cc307fcfe004470d12ded9c3d43472b67356029f8c6646bef1da7c831e662017c61880add4b76ed66000000000000000000000000000000001970da64e26cf1c95ee978572276439ecc380a55c107ef186de77b39b62db6de8710b8be2a3da1562657f070c6c4a0b70000000000000000000000000000000014d5a3b10d7494d04fbc9c8b20a94706acaa047f9d7794561ac78cb7265ab895de5cc53317eaeb359ab934b3372e2c8f5836b7075885650c30ec29a3703934bf50a28da102975deda77e758579ea3dfe
000000000000000000000000000000000cc4c37fe960036a9396e4375a2907de504a2608ab30fc7b65d236065be1b4d36d80cecf2744a4b0a8c76350e6e3ed700000000000000000000000000000000007b049472a134c3f9944101a6c68eda2176a3f37d569bbe2a1e64e27ab7ddfe0c8187e2379304a1f308c27a39ca7840c000000000000000000000000000000000674e7e5bf60228378b9b57de9a3602a92d60e40a5230f2913fddebf42bc19ce898fe671c5e6e3d6e1a7049c34664d82000000000000000000000000000000000b4b615a6f360b3f1cdd50ae6038bb0
@shamatar
shamatar / Vectors.txt
Created Feb 27, 2020
SW6 Bis test vectors
View Vectors.txt
To be extended
@shamatar
shamatar / Vectors.txt
Created Feb 26, 2020
BLS12_377 test vectors
View Vectors.txt
To be extended
@shamatar
shamatar / Vectors.txt
Created Feb 26, 2020
BLS12_381 test vectors
View Vectors.txt
Multiply G1 generator by zero:
Input: 0x17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb08b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e10000000000000000000000000000000000000000000000000000000000000000
Output: 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@shamatar
shamatar / vectors.txt
Last active Jan 18, 2020
EIP1962 bench vectors
View vectors.txt
Trim first byte if you use "operations" API
MNT4 753 bits 4 pairs.
035f01c4c62d92c41110229022eee2cdadb7f997505b8fafed5eb7e8f96c97d87307fdb925e8a0ed8d99d124d9a15af79db117e776f218059db80f0da5cb537e38685acce9767254a4638810719ac425f0e39d54522cdd119f5e9063de245e8001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000201373684a8c9dcae7a016ac5d7748d3313cd8e39051c596560835df0c9e50a5b59b882a92c78dc537e51a16703ec9855c77fc3d8bb21c8d68bb8cfb9db4b8c8fba773111c36c8b1b4e8f1ece940ef9eaad265458e06372009c9a0491678ef4600001c4c62d92c41110229022eee2cdadb7f997505b8fafed5eb7e8f96c97d87307fdb925e8a0ed8d99d124d9a15af79db26c5c28c859a99b3eebca9429212636b9dff97634993aa4d6c381bc3f0057974ea099170fa13a4fd90776e2400000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@shamatar
shamatar / Transcript
Last active Mar 9, 2019
ETH Paris "powers of tau" test ceremony transcript
View Transcript
2^25 powers
Alex Vlasov:
- make empty accumulator
Blank hash for an empty challenge:
786a02f7 42015903 c6c6fd85 2552d272
912f4740 e1584761 8a86e217 f71f5419
d25e1031 afee5853 13896444 934eb04b
903a685b 1448b755 d56f701a fe9be2ce
@shamatar
shamatar / tx.tcc
Created Oct 7, 2018
roll_up_for_fungible_tokens
View tx.tcc
namespace libsnark {
template<typename FieldT, typename HashT>
tx<FieldT,HashT>::tx(protoboard<FieldT> &pb,
pb_variable_array<FieldT> &pub_key_x_bin, // sender's pubkey X
pb_variable_array<FieldT> &pub_key_y_bin, // sender's pubkey Y
pb_variable_array<FieldT> &balance_bin, // sender's leaf's balance
pb_variable_array<FieldT> &balance_recipient_bin, // recipients's leaf's balance
pb_variable_array<FieldT> &balance_new_bin, // sender's leaf's balance
pb_variable_array<FieldT> &balance_recipient_new_bin, // recipients's leaf's balance
pb_variable_array<FieldT> &tx_amount_bin, // tx amount
View gist:332f74985f2fab723f9358cf8dd5c9f4
0 20933170699147567579033322641963108696395791188513690084963135910641532928274 2442431204756310761602153127686318554574960794578976757443433976540189788252 0 4887099059762129640302984526748584436465700498472647690070911027557383648471 1537761002038265777208458665898474687934111788158087930192782735780488615370
0 16573055444656122843537507139515729097968881044881963088535952613432732109576 15823969213404520820670755358760897637430302424438918422654019939237973220852 19043350362690960802787632939519229156536345342250133376920132587983219143570 5672529627952885536591336430691382520056316077527491874420269967257820619040 0 14461792803667918890803887317933444090830840712748147371492463942958574209725 13071829618513332891552585680079909704651276111106970019151699080596107269576
0 4553363573730177428827227824438616079346298937519779886664801330607001971471 21456699004685635406151940504311915468194491877421700836100090035559356021754 0 5750931461328290137207375961192256416814227690413125433502291640571740409967 8930
@shamatar
shamatar / gist:ee70d599b4063fe4477d3bd4c6594349
Created Aug 25, 2018
Find embedded curve for BN256 snarks
View gist:ee70d599b4063fe4477d3bd4c6594349
#check BN-curve from etherium
BN_p = 21888242871839275222246405745257275088696311157297823662689037894645226208583
BN_curve = EllipticCurve(GF(BN_p),[0,3])
BN_order = BN_curve.order()
# print BN_order in Primes()
# print BN_order % 4
#we are going to use algorithm described in
#https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/NIST.pdf
#see also: http://iml.univ-mrs.fr/ati/crypto_puces/2009/slides/ivey-law.pdf