2025-03-26 11:46:34 +01:00
|
|
|
//test
|
|
|
|
|
pragma circom 2.1.9;
|
|
|
|
|
|
2025-03-26 14:44:56 +01:00
|
|
|
include "../hash_bn/poseidon2_hash.circom";
|
|
|
|
|
include "../misc/constants.circom";
|
2025-03-26 11:46:34 +01:00
|
|
|
|
2025-08-26 10:37:51 +02:00
|
|
|
template derive_secret_key(){
|
|
|
|
|
signal input starting_slot;
|
|
|
|
|
signal input secrets_root;
|
|
|
|
|
signal output out;
|
|
|
|
|
|
|
|
|
|
component hash = Poseidon2_hash(3);
|
|
|
|
|
component dst = NOMOS_POL_SK_V1();
|
|
|
|
|
hash.inp[0] <== dst.out;
|
|
|
|
|
hash.inp[1] <== starting_slot;
|
|
|
|
|
hash.inp[2] <== secrets_root;
|
|
|
|
|
|
|
|
|
|
out <== hash.out;
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-26 11:46:34 +01:00
|
|
|
template derive_public_key(){
|
|
|
|
|
signal input secret_key;
|
|
|
|
|
signal output out;
|
|
|
|
|
|
2025-11-17 10:55:09 +01:00
|
|
|
component hash = Poseidon2_hash(2);
|
2025-08-26 10:37:51 +02:00
|
|
|
component dst = NOMOS_KDF();
|
2025-03-26 14:44:56 +01:00
|
|
|
hash.inp[0] <== dst.out;
|
2025-03-26 11:46:34 +01:00
|
|
|
hash.inp[1] <== secret_key;
|
|
|
|
|
out <== hash.out;
|
2025-05-26 11:05:08 +02:00
|
|
|
}
|