Function derive_key

Source
pub fn derive_key(
    context: &CoPRFEvaluatorContext,
    key_id: &[u8],
) -> Result<CoPRFKey, Error>
Expand description

ยงE.1.5. Evaluation Key Derivation

[Lehman] recommends a key derivation procedure using an underlying PRF which maps from bitstrings to a finite field, such that the field is compatible with the homomorphism afforded by the encryption scheme.

Concretely in our case, PRF evaluation keys should be scalars in P256. To achieve this, we use the rejection sampling method outlined in [RFC9180].