pub struct Identity<S: Subject>(/* private fields */);Expand description
One identity this compiler derived, tagged by the subject it names.
Holding one means these thirty-two bytes came from a complete Transcript under the profile that transcript names, and would come out the same again from the same transcript on any machine.
§Authority
Collision resistance is claimed AS BLAKE3’s, for the transcript as Transcript specifies it, at the Version the deriving Profile declares — and nothing broader.
§Construction
The only road is Identity::derived, which takes a typed transcript; nothing wraps arbitrary bytes.
S is a PhantomData parameter, so an identity naming one subject is a different type than one naming another regardless of bytes, and their derive-key contexts differ too — the separation is a runtime fact and not only a compile-time one.
§Nonclaims
It does not claim that two things this compiler considers different always have different transcripts; that is the transcript’s completeness, which each mint site owns and documents.
Implementations§
Source§impl<S: Subject> Identity<S>
impl<S: Subject> Identity<S>
Sourcepub fn derived(transcript: Transcript<'_>) -> Self
pub fn derived(transcript: Transcript<'_>) -> Self
Derive one identity from its complete transcript. Deterministic and total: every transcript names an identity.
Sourcepub fn derived_with_provenance(transcript: Transcript<'_>) -> (Self, Provenance)
pub fn derived_with_provenance(transcript: Transcript<'_>) -> (Self, Provenance)
Derive one identity and the record of how it was derived.
The record is for a value that is going to keep it — one whose identity a reader may be handed on its own and asked to account for.
A caller with nowhere to put one takes Identity::derived, and the record is simply not made rather than made and carried by everything.