auth 0.0.1
Authenticated computation with C++26 modules
Loading...
Searching...
No Matches
auth::verifier Struct Referenceexport
module auth

Reconstructs and verifies openings from a borrowed proof buffer. More...

Classes

class  sealed
 A copyable digest commitment with no resident payload. More...

Public Member Functions

 verifier (std::span< const std::uint8_t > proof)
 Starts replay at the beginning of a borrowed proof.
 verifier (bytes &&)=delete
 Rejects a temporary owning buffer that would leave dangling pointers.
template<class T>
sealed< T > seal (T value) const
 Computes a digest-only sealed value without reading the proof.
template<class T>
T unseal (sealed< T > p)
 Decodes the next value and checks the digest of exactly its consumed bytes.
void finish () const
 Checks that replay consumed every proof byte.

Detailed Description

Reconstructs and verifies openings from a borrowed proof buffer.

Note
The proof storage must outlive the verifier and remain unchanged.

Definition at line 89 of file auth.ccm.

Constructor & Destructor Documentation

◆ verifier()

auth::verifier::verifier ( std::span< const std::uint8_t > proof)
inlineexplicit

Starts replay at the beginning of a borrowed proof.

Parameters
proofImmutable serialized openings whose storage outlives this verifier.

Definition at line 118 of file auth.ccm.

Member Function Documentation

◆ finish()

void auth::verifier::finish ( ) const
inline

Checks that replay consumed every proof byte.

Exceptions
auth_errorIf unused bytes remain.

Definition at line 164 of file auth.ccm.

◆ seal()

template<class T>
sealed< T > auth::verifier::seal ( T value) const
inline

Computes a digest-only sealed value without reading the proof.

Parameters
valuePayload to serialize and hash; it is not retained.
Returns
A commitment with the same digest as prover::seal for the same encoding.
Note
Serialization, allocation, and payload construction exceptions propagate.

Definition at line 129 of file auth.ccm.

◆ unseal()

template<class T>
T auth::verifier::unseal ( sealed< T > p)
inline

Decodes the next value and checks the digest of exactly its consumed bytes.

Parameters
pCommitment to the next serialized value.
Returns
The reconstructed payload.
Exceptions
auth_errorIf input is truncated, malformed, or does not match the digest.
Note
The cursor advances only after successful return construction. Any failure leaves it unchanged. A zero-byte value does not advance the cursor.

Definition at line 141 of file auth.ccm.


The documentation for this struct was generated from the following file: