diff --git a/src/public_key.rs b/src/public_key.rs index 2267b92..b286b02 100644 --- a/src/public_key.rs +++ b/src/public_key.rs @@ -1,6 +1,6 @@ use std::convert::TryFrom; -use crate::Error; +use crate::{Error, Signature}; /// A refinement type indicating that the inner `[u8; 32]` represents an /// encoding of a RedJubJub public key. @@ -39,3 +39,11 @@ impl TryFrom for PublicKey { unimplemented!(); } } + +// This is similar to impl signature::Verifier but without boxed errors +impl PublicKey { + /// Verify a supposed `signature` over `msg` made by this public key. + pub fn verify(&self, msg: &[u8], signature: &Signature) -> Result<(), Error> { + unimplemented!(); + } +} diff --git a/src/secret_key.rs b/src/secret_key.rs index e54b076..dddf7d2 100644 --- a/src/secret_key.rs +++ b/src/secret_key.rs @@ -1,6 +1,6 @@ use std::convert::TryFrom; -use crate::Error; +use crate::{Error, PublicKey, Signature}; /// A refinement type indicating that the inner `[u8; 32]` represents an /// encoding of a RedJubJub secret key. @@ -32,6 +32,7 @@ impl From for SecretKeyBytes { } } +// XXX could this be a From impl? impl TryFrom for SecretKey { type Error = Error; @@ -39,3 +40,17 @@ impl TryFrom for SecretKey { unimplemented!(); } } + +impl<'a> From<&'a SecretKey> for PublicKey { + fn from(sk: &'a SecretKey) -> PublicKey { + unimplemented!(); + } +} + +// Similar to signature::Signer but without boxed errors. +impl SecretKey { + /// Sign the given `msg` with this `SecretKey`. + pub fn sign(&self, msg: &[u8]) -> Signature { + unimplemented!(); + } +}