Просмотр исходного кода

crypto/schnorr: Add function to make a dummy signature.

parazyd 4 лет назад
Родитель
Сommit
51aa4eb767
1 измененных файлов с 7 добавлено и 1 удалено
  1. 7 1
      src/crypto/schnorr.rs

+ 7 - 1
src/crypto/schnorr.rs

@@ -2,7 +2,7 @@ use std::io;
 
 use halo2_gadgets::ecc::chip::FixedPoint;
 use pasta_curves::{
-    group::{ff::Field, GroupEncoding},
+    group::{ff::Field, Group, GroupEncoding},
     pallas,
 };
 use rand::rngs::OsRng;
@@ -23,6 +23,12 @@ pub struct Signature {
     response: pallas::Scalar,
 }
 
+impl Signature {
+    pub fn dummy() -> Self {
+        Self { commit: pallas::Point::identity(), response: pallas::Scalar::zero() }
+    }
+}
+
 pub trait SchnorrSecret {
     fn sign(&self, message: &[u8]) -> Signature;
 }