Add rerandomization stub API.
This commit is contained in:
parent
b094cd92b9
commit
eaaad6a0b8
|
@ -9,6 +9,9 @@ mod public_key;
|
|||
mod secret_key;
|
||||
mod signature;
|
||||
|
||||
/// An element of the JubJub scalar field used for randomization of public and secret keys.
|
||||
pub type Randomizer = jubjub::Fr;
|
||||
|
||||
pub use error::Error;
|
||||
pub use public_key::{PublicKey, PublicKeyBytes};
|
||||
pub use secret_key::{SecretKey, SecretKeyBytes};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::convert::TryFrom;
|
||||
|
||||
use crate::{Error, Signature};
|
||||
use crate::{Error, Randomizer, Signature};
|
||||
|
||||
/// A refinement type indicating that the inner `[u8; 32]` represents an
|
||||
/// encoding of a RedJubJub public key.
|
||||
|
@ -40,9 +40,14 @@ impl TryFrom<PublicKeyBytes> for PublicKey {
|
|||
}
|
||||
}
|
||||
|
||||
// This is similar to impl signature::Verifier but without boxed errors
|
||||
impl PublicKey {
|
||||
/// Randomize this public key with the given `randomizer`.
|
||||
pub fn randomize(&self, randomizer: Randomizer) -> PublicKey {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
/// Verify a supposed `signature` over `msg` made by this public key.
|
||||
// This is similar to impl signature::Verifier but without boxed errors
|
||||
pub fn verify(&self, msg: &[u8], signature: &Signature) -> Result<(), Error> {
|
||||
unimplemented!();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::convert::TryFrom;
|
||||
|
||||
use crate::{Error, PublicKey, Signature};
|
||||
use crate::{Error, Randomizer, PublicKey, Signature};
|
||||
|
||||
/// A refinement type indicating that the inner `[u8; 32]` represents an
|
||||
/// encoding of a RedJubJub secret key.
|
||||
|
@ -47,9 +47,14 @@ impl<'a> From<&'a SecretKey> for PublicKey {
|
|||
}
|
||||
}
|
||||
|
||||
// Similar to signature::Signer but without boxed errors.
|
||||
impl SecretKey {
|
||||
/// Randomize this public key with the given `randomizer`.
|
||||
pub fn randomize(&self, randomizer: Randomizer) -> PublicKey {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
/// Sign the given `msg` with this `SecretKey`.
|
||||
// Similar to signature::Signer but without boxed errors.
|
||||
pub fn sign(&self, msg: &[u8]) -> Signature {
|
||||
unimplemented!();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue