[][src]Struct challenge_bypass_ristretto::voprf::SigningKey

#[repr(C)]
pub struct SigningKey { pub public_key: PublicKey, pub(crate) k: Scalar, }

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

Methods

impl SigningKey[src]

pub fn random<T: Rng + CryptoRng>(rng: &mut T) -> Self[src]

Generates a new random SigningKey using the provided random number generator.

pub fn sign(&self, P: &BlindedToken) -> Result<SignedToken, TokenError>[src]

Signs the provided BlindedToken

Returns None if the BlindedToken point is not valid.

pub fn rederive_unblinded_token(&self, t: &TokenPreimage) -> UnblindedToken[src]

Rederives an UnblindedToken via the token preimage of the provided UnblindedToken

W' = T^k = H_1(t)^k

pub fn to_bytes(&self) -> [u8; 32][src]

Convert this SigningKey to a byte array.

fn bytes_length_error() -> TokenError[src]

pub fn from_bytes(bytes: &[u8]) -> Result<SigningKey, TokenError>[src]

Construct a SigningKey from a slice of bytes.

Trait Implementations

impl Debug for SigningKey[src]

impl Drop for SigningKey[src]

Overwrite signing key with null when it goes out of scope.

Auto Trait Implementations

impl Send for SigningKey

impl Sync for SigningKey

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self