pub struct PairingToken(/* private fields */);Expand description
A pairing token, held as the digest of the code and nothing else.
The plaintext never lives in this type. PairingToken::mint hands the
readable code straight back to its caller, who shows it to a person once,
and keeps only what verification needs. Sealing a value and then exposing
it on the next line would be theatre; not holding it at all is the
property we actually wanted.
Implementations§
Source§impl PairingToken
impl PairingToken
Sourcepub fn mint(entropy: [u8; 32]) -> (Self, String)
pub fn mint(entropy: [u8; 32]) -> (Self, String)
Mints a token from caller-supplied entropy, returning the token and the code to display exactly once.
Deterministic in entropy: same bytes, same token. The randomness
lives in whoever fills entropy, which is the assembly layer’s seeded
generator, never a sample taken here.
Trait Implementations§
Source§impl Clone for PairingToken
impl Clone for PairingToken
impl Copy for PairingToken
Source§impl Debug for PairingToken
impl Debug for PairingToken
impl Eq for PairingToken
Source§impl PartialEq for PairingToken
impl PartialEq for PairingToken
impl StructuralPartialEq for PairingToken
Auto Trait Implementations§
impl Freeze for PairingToken
impl RefUnwindSafe for PairingToken
impl Send for PairingToken
impl Sync for PairingToken
impl Unpin for PairingToken
impl UnsafeUnpin for PairingToken
impl UnwindSafe for PairingToken
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
Mutably borrows from an owned value. Read more