pub struct OprfEntrypoint<'a> { /* private fields */ }Expand description
The main entry point to execute OPRF computations using the OPRF nodes.
Implementations§
Source§impl<'a> OprfEntrypoint<'a>
impl<'a> OprfEntrypoint<'a>
pub fn new( services: &'a [String], threshold: usize, query_material: &'a CircomGroth16Material, authenticator_input: &'a AuthenticatorProofInput, connector: &'a Connector, ) -> Self
Sourcepub async fn gen_credential_blinding_factor<R: CryptoRng + RngCore>(
&self,
rng: &mut R,
issuer_schema_id: u64,
) -> Result<(FieldElement, ShareEpoch), ProofError>
pub async fn gen_credential_blinding_factor<R: CryptoRng + RngCore>( &self, rng: &mut R, issuer_schema_id: u64, ) -> Result<(FieldElement, ShareEpoch), ProofError>
Generates a blinding factor for a Credential’s sub through the OPRF nodes.
This method will handle the signature from the Authenticator authorizing the request for the OPRF nodes.
§Arguments
issuer_schema_id: The schema ID of the credential issuer for which the blinding factor is being generated.
§Errors
Returns ProofError in the following cases:
PublicKeyNotFound- the public key for the given authenticator private key is not found in thekey_set.InvalidDLogProof– theDLogequality proof could not be verified.- Other errors may propagate from network requests, proof generation, or Groth16 verification.
Sourcepub async fn gen_nullifier<R: CryptoRng + RngCore>(
&self,
rng: &mut R,
proof_request: &ProofRequest,
) -> Result<FullOprfOutput, ProofError>
pub async fn gen_nullifier<R: CryptoRng + RngCore>( &self, rng: &mut R, proof_request: &ProofRequest, ) -> Result<FullOprfOutput, ProofError>
Generates a nullifier through the provided OPRF nodes for a specific proof request.
§Note on Session Proofs
A randomized action is required on Session Proofs to ensure the output nullifier from the Uniqueness Proof
circuit is unique (otherwise the one-time use property of nullifiers would fail). Please see the “Future”
section in the SessionNullifier documentation for more details on how this is expected to be deprecated with
a future update.
§Errors
Returns ProofError in the following cases:
PublicKeyNotFound- the public key for the given authenticator private key is not found in thekey_set.InvalidDLogProof– theDLogequality proof could not be verified.- Other errors may propagate from network requests, proof generation, or Groth16 verification.
Auto Trait Implementations§
impl<'a> Freeze for OprfEntrypoint<'a>
impl<'a> !RefUnwindSafe for OprfEntrypoint<'a>
impl<'a> Send for OprfEntrypoint<'a>
impl<'a> Sync for OprfEntrypoint<'a>
impl<'a> Unpin for OprfEntrypoint<'a>
impl<'a> UnsafeUnpin for OprfEntrypoint<'a>
impl<'a> !UnwindSafe for OprfEntrypoint<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more