SHA3-512 commitment verification (CONIKS value commitments).
A commitment is SHA3-512_with_context(context, opening(32 bytes) || value).
Given the public context label, the 64-byte commitment, the committed
value, and the 32-byte opening, verify/4 recomputes and constant-time
compares.
All binary arguments are base64-encoded.
Summary
Functions
Boolean form of verify/4. Returns true only on a valid opening.
@spec verify( context :: String.t(), commitment_b64 :: String.t(), value_b64 :: String.t(), opening_b64 :: String.t() ) :: :ok | {:error, String.t()}
Verify that commitment opens to value under opening and context.
Returns :ok or {:error, reason}.
Example
:ok = MetamorphicLog.Commitment.verify(context, commitment, value, opening)