pub struct StoreContext { /* private fields */ }

Implementations§

source§

impl StoreContext

source

pub fn setup(randomness: &mut Randomness) -> Result<Self, Error>

§Data Store Setup

On setup, a data store initializes a coPRFReceiverContext, derives a pair of encryption and decryption keys for the RPKE as well as a private PRP key.

Inputs:
    randomness: (NcoPRFReceiver + NRPKEKeyGen + NPRP) uniformly random bytes

Outputs:
    coprf_receiver_context: CoPRFReceiverContext
    ek: RPKE.EncryptionKey
    dk: RPKE.DecryptionKey
    k_prp: PRP.PRPKey

fn setup(randomness) -> StoreContext:
    let coprf_receiver_context =
    CoPRFReceiverContext::new(randomness[NcoPRFReceiver]);
    let (ek, dk) = RPKE.generate_keys(randomness[NRPKEKeyGen]);
    let k_prp = PRP.KeyGen(randomness[NPRP]);
    StoreContext{
      coprf_receiver_context,
      ek,
      dk,
      k_prp
    }
source

pub fn public_keys(&self) -> (StoreEncryptionKey, BlindingPublicKey)

Given a store context generated as above, the following methods are available:

  • Retrieve store public keys for encryption and coPRF blinding.
Input:
    context: StoreContext
Output:
    ek: RPKE.EncryptionKey
    bpk: CoPRF.BlindingPublicKey

fn public_keys(context):
    let ek = context.ek;
    let bpk = context.coprf_receiver_context.public_key()
    return (ek, bpk);
source

pub fn finalize_pseudonym( &self, blind_pseudonym: BlindedPseudonymizedHandle ) -> Result<FinalizedPseudonym, Error>

  • Finalize Pseudonym: As part of the finalization of a split or join conversion the raw pseudonyms that are the unblinded result of coPRF evaluation are further hardened by application of a PRP.
Input:
    context: StoreContext
    blind_pseudonym: CoPRFBlindOutput
Output:
    pseudonym: Pseudonym

fn finalize_pseudonym(context, blind_pseudonym):
    let raw_pseudonym =
    context.coprf_receiver_context.finalize(blind_pseudonym);
    return PRP.eval(context.k_prp, raw_pseudonym)
source

pub fn recover_raw_pseudonym( &self, pseudonym: FinalizedPseudonym ) -> Result<P256Point, Error>

  • Recover Raw Pseudonym: In preparation of a join conversion, the raw pseudonyms, i.e. coPRF outputs must be recovered from the hardened pseudonyms before they can be sent to the converter for blind conversion.

    Inputs:
        context: StoreContext
        pseudonym: Pseudonym
    
    Output:
        raw_pseudonym: CoPRFOutput
    
    fn recover_raw_pseudonym(context, pseudonym):
        return PRP.invert(context.k_prp, pseudonym)
    

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V