Skip to content

Commit

Permalink
try keccak
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamWuGit committed Oct 29, 2024
1 parent a864510 commit 991bee2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions eth-types/src/sign_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,19 @@ static SIGN_DATA_DEFAULT_R1: LazyLock<SignData<Fq_R1, Secp256r1Affine>> = LazyLo
let pk = pk.to_affine();

let msg = [0u8; 32];
let msg_hash = Fq_R1::one();
let signature = sign::<Fp_R1, Fq_R1, Secp256r1Affine>(Fq_R1::one(), sk, msg_hash);
//let msg_hash = Fq_R1::one();

let msg_hash = keccak256(msg);
let msg_hash_fq = Fq_R1::from_bytes(&msg_hash).unwrap();

let signature = sign::<Fp_R1, Fq_R1, Secp256r1Affine>(Fq_R1::one(), sk, msg_hash_fq);

SignData {
signature,
pk,
msg: msg.into(),
msg_hash,
//msg_hash,
msg_hash: msg_hash_fq,
}
});

Expand Down

0 comments on commit 991bee2

Please sign in to comment.