Struct challenge_bypass_ristretto::oprf::SigningKey
source · #[repr(C)]pub struct SigningKey {
pub public_key: PublicKey,
pub(crate) k: Scalar,
}
Expand description
A SigningKey
is used to sign a BlindedToken
and verify an UnblindedToken
.
This is a server secret and should NEVER be revealed to the client.
Fields§
§public_key: PublicKey
A PublicKey
showing a committment to this particular key
k: Scalar
k
is the actual key
Implementations§
source§impl SigningKey
impl SigningKey
sourcepub fn random<T: Rng + CryptoRng>(rng: &mut T) -> Self
pub fn random<T: Rng + CryptoRng>(rng: &mut T) -> Self
Generates a new random SigningKey
using the provided random number generator.
sourcepub fn sign(&self, P: &BlindedToken) -> Result<SignedToken, TokenError>
pub fn sign(&self, P: &BlindedToken) -> Result<SignedToken, TokenError>
Signs the provided BlindedToken
Returns None if the BlindedToken
point is not valid.
sourcepub fn rederive_unblinded_token(&self, t: &TokenPreimage) -> UnblindedToken
pub fn rederive_unblinded_token(&self, t: &TokenPreimage) -> UnblindedToken
Rederives an UnblindedToken
via the token preimage of the provided UnblindedToken
W’ = T^k = H_1(t)^k
fn bytes_length_error() -> TokenError
sourcepub fn from_bytes(bytes: &[u8]) -> Result<SigningKey, TokenError>
pub fn from_bytes(bytes: &[u8]) -> Result<SigningKey, TokenError>
Construct a SigningKey
from a slice of bytes.
Trait Implementations§
source§impl Clone for SigningKey
impl Clone for SigningKey
source§fn clone(&self) -> SigningKey
fn clone(&self) -> SigningKey
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SigningKey
impl Debug for SigningKey
Auto Trait Implementations§
impl Freeze for SigningKey
impl RefUnwindSafe for SigningKey
impl Send for SigningKey
impl Sync for SigningKey
impl Unpin for SigningKey
impl UnwindSafe for SigningKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more