Struct blindsign::request::BlindRequest[][src]

pub struct BlindRequest { /* fields omitted */ }

For managing the requester steps of the blind signature protocol. Actually initiating the protocol such that the signer knows to begin the first step (generating R') is orthogonal to this crate.

Methods

impl BlindRequest
[src]

Perform the first set of requester side steps toward acquiring a blindly signed message. Generates a random 32 byte scalar to use as the message, seeing as it is uncommon to need any particular message to be blindly signed.

Arguments

  • 'rp' - A reference to a 32 byte CompressedRistrettoPoint represented as a [u8; 32]. This is the R' value received from the siger in response to a request for protocol initiation, though how it is requested or received is orthogonal to this crate.

Type Paramaeters

H is the hash algorithm that will be used for generating e

Returns

  • Ok(([u8; 32], BlindRequest)) on success. The [u8; 32] represents the value e', which is sent to the server for blind signing.

  • Err(::Error) variant on error, which could be caused by the failure to initiate the RNG, or otherwise being input a malformed R' value from the signer.

Mathematics

  • R = uR' + vP
  • u = Randomly Generated Scalar by requester
  • v = Randomly Generated Scalar by requester

  • e = H(R||m)
  • H() = A hash function producing 64 byte outputs
  • m = The bytes of the message to be blindly signed

  • e' = e / u

The same as new, but allows for passing in a specific message value 'm' to be blindly signed.

Input the blinded signature S' from the signer, consumes self and creates the complete blindly signed message structure. Note that this method does not actually verify that a correct sp value was received from the signer, only that it was a valid canonical scalar.

Arguments

  • 'sp' - A reference to a 32 byte Scalar represented as a [u8; 32]. This scalar is received from the signer and is the signature on the value e'.

Returns

  • Ok(UnblindedSigData) on success. The UnblindedSigData consists of

  1. The unblinded S' value = S, the signature (on unblinded e' value, which is e = H(msg||R))

  2. The e value (which is the unblinded e' value, on which S is the signature)

  3. The R value (which is the unblinded R' value that was originally received from the signer)

  • Err(::Error) on error. The only error is if the input sp is not a valid scalar. Note that this method does not actually ensure that the signature is valid, only that the scalar of the signature is correctly formed.

Mathematics

  • S = S' * u + v
  • v = Random scalar previously generated by requester
  • u = Random scalar previously generated by requester

Auto Trait Implementations