sdk/crypto: Forbid PublicKey to ever be the identity point

This commit is contained in:
parazyd
2024-02-20 14:55:57 +01:00
parent dc203e12f0
commit 47e9d68ef1
10 changed files with 51 additions and 32 deletions

View File

@@ -79,7 +79,8 @@ fn zkvm_opcodes() -> Result<()> {
let ephem_secret = SecretKey::random(&mut OsRng);
let pubkey = PublicKey::from_secret(ephem_secret).inner();
let (ephem_x, ephem_y) = PublicKey::from(pubkey * fp_mod_fv(ephem_secret.inner())).xy();
let (ephem_x, ephem_y) =
PublicKey::try_from(pubkey * fp_mod_fv(ephem_secret.inner())).unwrap().xy();
let prover_witnesses = vec![
Witness::Base(Value::known(pallas::Base::from(value))),