mirror of
https://github.com/logos-blockchain/logos-blockchain-pocs.git
synced 2026-01-02 13:13:09 +00:00
Merge pull request #101 from logos-co/tl/fix_pol_cst
swhitch to big endian everywhere
This commit is contained in:
commit
1435ae4005
@ -221,7 +221,7 @@ if not core_or_leader in [0,1]:
|
||||
# 1) Core‐node registry Merkle‐proof
|
||||
# pick a random core_sk and derive its public key
|
||||
core_sk = F(randrange(0,p,1))
|
||||
pk_core = poseidon2_hash([ F(1296193216988918402894), core_sk ])
|
||||
pk_core = poseidon2_hash([ F(1444560348471047701574), core_sk ])
|
||||
core_selectors = randrange(0,2**20,1)
|
||||
core_selectors = format(int(core_selectors),'020b')
|
||||
core_nodes = [F(randrange(0,p,1)) for i in range(20)]
|
||||
@ -263,15 +263,15 @@ for i in range(25):
|
||||
secret_root = poseidon2_hash([secret_root,slot_secret_path[i]])
|
||||
else:
|
||||
secret_root = poseidon2_hash([slot_secret_path[i],secret_root])
|
||||
sk = poseidon2_hash([F(256174383281726064679014503048630094),starting_slot,secret_root])
|
||||
pk = poseidon2_hash([F(1296193216988918402894),sk])
|
||||
sk = poseidon2_hash([F(406607590443025360526585251810465329),starting_slot,secret_root])
|
||||
pk = poseidon2_hash([F(1444560348471047701574),sk])
|
||||
|
||||
note_id = poseidon2_hash([F(65580641562429851895355409762135920462),tx_hash,output_number,value,pk])
|
||||
ticket = poseidon2_hash([F(13887241025832268),F(epoch_nonce),F(slot_number),note_id,sk])
|
||||
note_id = poseidon2_hash([F(104091543153414482850642014312194856497),tx_hash,output_number,value,pk])
|
||||
ticket = poseidon2_hash([F(21468244852299313),F(epoch_nonce),F(slot_number),note_id,sk])
|
||||
while(ticket > threshold):
|
||||
output_number += 1
|
||||
note_id = poseidon2_hash([F(65580641562429851895355409762135920462),tx_hash,output_number,value,pk])
|
||||
ticket = poseidon2_hash([F(13887241025832268),F(epoch_nonce),F(slot_number),note_id,sk])
|
||||
note_id = poseidon2_hash([F(104091543153414482850642014312194856497),tx_hash,output_number,value,pk])
|
||||
ticket = poseidon2_hash([F(21468244852299313),F(epoch_nonce),F(slot_number),note_id,sk])
|
||||
|
||||
aged_nodes = [F(randrange(0,p,1)) for i in range(32)]
|
||||
aged_selectors = randrange(0,2**32,1)
|
||||
|
||||
@ -244,15 +244,15 @@ for i in range(25):
|
||||
secret_root = poseidon2_hash([secret_root,slot_secret_path[i]])
|
||||
else:
|
||||
secret_root = poseidon2_hash([slot_secret_path[i],secret_root])
|
||||
sk = poseidon2_hash([F(256174383281726064679014503048630094),starting_slot,secret_root])
|
||||
pk = poseidon2_hash([F(1296193216988918402894),sk])
|
||||
sk = poseidon2_hash([F(406607590443025360526585251810465329),starting_slot,secret_root])
|
||||
pk = poseidon2_hash([F(1444560348471047701574),sk])
|
||||
|
||||
note_id = poseidon2_hash([F(65580641562429851895355409762135920462),tx_hash,output_number,value,pk])
|
||||
ticket = poseidon2_hash([F(13887241025832268),F(epoch_nonce),F(slot_number),note_id,sk])
|
||||
note_id = poseidon2_hash([F(104091543153414482850642014312194856497),tx_hash,output_number,value,pk])
|
||||
ticket = poseidon2_hash([F(21468244852299313),F(epoch_nonce),F(slot_number),note_id,sk])
|
||||
while(ticket > threshold):
|
||||
output_number += 1
|
||||
note_id = poseidon2_hash([F(65580641562429851895355409762135920462),tx_hash,output_number,value,pk])
|
||||
ticket = poseidon2_hash([F(13887241025832268),F(epoch_nonce),F(slot_number),note_id,sk])
|
||||
note_id = poseidon2_hash([F(104091543153414482850642014312194856497),tx_hash,output_number,value,pk])
|
||||
ticket = poseidon2_hash([F(21468244852299313),F(epoch_nonce),F(slot_number),note_id,sk])
|
||||
|
||||
aged_nodes = [F(randrange(0,p,1)) for i in range(32)]
|
||||
aged_selectors = randrange(0,2**32,1)
|
||||
|
||||
@ -208,7 +208,7 @@ def PoseidonSponge(data, capacity, output_len):
|
||||
|
||||
|
||||
secret_voucher = F(randrange(0,p,1))
|
||||
reward_voucher = poseidon2_hash([F(1668646695034522932676805048878418),secret_voucher])
|
||||
reward_voucher = poseidon2_hash([F(1668651334877449245987336926807378),secret_voucher])
|
||||
|
||||
merkle_nodes = [F(randrange(0,p,1)) for i in range(32)]
|
||||
selectors = randrange(0,2**32,1)
|
||||
|
||||
@ -4,64 +4,64 @@ pragma circom 2.1.9;
|
||||
include "../circomlib/circuits/bitify.circom";
|
||||
include "../circomlib/circuits/comparators.circom";
|
||||
|
||||
// int.from_bytes(b"LEAD_V1", byteorder="little") = 13887241025832268
|
||||
// int.from_bytes(b"LEAD_V1", byteorder="big") = 21468244852299313
|
||||
template LEAD_V1(){
|
||||
signal output out;
|
||||
out <== 13887241025832268;
|
||||
out <== 21468244852299313;
|
||||
}
|
||||
|
||||
|
||||
// int.from_bytes(b"NOMOS_POL_SK_V1", byteorder="little") = 256174383281726064679014503048630094
|
||||
// int.from_bytes(b"NOMOS_POL_SK_V1", byteorder="big") = 406607590443025360526585251810465329
|
||||
template NOMOS_POL_SK_V1(){
|
||||
signal output out;
|
||||
out <== 256174383281726064679014503048630094;
|
||||
out <== 406607590443025360526585251810465329;
|
||||
}
|
||||
|
||||
|
||||
// int.from_bytes(b"NOMOS_NONCE_CONTRIB_V1", byteorder="little") = 18459309511848927313552932915476467038165525790019406
|
||||
// int.from_bytes(b"NOMOS_NONCE_CONTRIB_V1", byteorder="big") = 29299164684883585569547934353856711107288148897388081
|
||||
template NOMOS_NONCE_CONTRIB_V1(){
|
||||
signal output out;
|
||||
out <== 18459309511848927313552932915476467038165525790019406;
|
||||
out <== 29299164684883585569547934353856711107288148897388081;
|
||||
}
|
||||
|
||||
|
||||
// int.from_bytes(b"NOMOS_KDF", byteorder="little") = 1296193216988918402894
|
||||
// int.from_bytes(b"NOMOS_KDF", byteorder="big") = 1444560348471047701574
|
||||
template NOMOS_KDF(){
|
||||
signal output out;
|
||||
out <== 1296193216988918402894;
|
||||
out <== 1444560348471047701574;
|
||||
}
|
||||
|
||||
|
||||
// int.from_bytes(b"NOMOS_NOTE_ID_V1", byteorder="little") = 65580641562429851895355409762135920462
|
||||
// int.from_bytes(b"NOMOS_NOTE_ID_V1", byteorder="big") = 104091543153414482850642014312194856497
|
||||
template NOMOS_NOTE_ID_V1(){
|
||||
signal output out;
|
||||
out <== 65580641562429851895355409762135920462;
|
||||
out <== 104091543153414482850642014312194856497;
|
||||
}
|
||||
|
||||
|
||||
// int.from_bytes(b"SELECTION_RANDOMNESS_V1", byteorder="little") = 4725583332308041445519605499429790922252397838206780755
|
||||
// int.from_bytes(b"SELECTION_RANDOMNESS_V1", byteorder="big") = 7975748052709904163696334751877473705917106215133861425
|
||||
template SELECTION_RANDOMNESS_V1(){
|
||||
signal output out;
|
||||
out <== 4725583332308041445519605499429790922252397838206780755;
|
||||
out <== 7975748052709904163696334751877473705917106215133861425;
|
||||
}
|
||||
|
||||
|
||||
// int.from_bytes(b"KEY_NULLIFIER_V1", byteorder="little") = 65580642670359595206974785265459610955
|
||||
// int.from_bytes(b"KEY_NULLIFIER_V1", byteorder="big") = 100052180852480707195751331170348914225
|
||||
template KEY_NULLIFIER_V1(){
|
||||
signal output out;
|
||||
out <== 65580642670359595206974785265459610955;
|
||||
out <== 100052180852480707195751331170348914225;
|
||||
}
|
||||
|
||||
|
||||
// int.from_bytes(b"REWARD_VOUCHER", byteorder="little") = 1668646695034522932676805048878418
|
||||
// int.from_bytes(b"REWARD_VOUCHER", byteorder="big") = 1668651334877449245987336926807378
|
||||
template REWARD_VOUCHER(){
|
||||
signal output out;
|
||||
out <== 1668646695034522932676805048878418;
|
||||
out <== 1668651334877449245987336926807378;
|
||||
}
|
||||
|
||||
|
||||
// int.from_bytes(b"VOUCHER_NF", byteorder="little") = 332011368467182873038678
|
||||
// int.from_bytes(b"VOUCHER_NF", byteorder="big") = 407586954142391778364998
|
||||
template VOUCHER_NF(){
|
||||
signal output out;
|
||||
out <== 332011368467182873038678;
|
||||
out <== 407586954142391778364998;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user