Expand description
Secret bytes and the zeroize helpers.
This module is the one import path for zeroization in libxmtp:
Secretowns secret bytes in a struct field, a return value or a long-lived binding. It is wiped on drop and itsDebugshows only the length.Zeroizingwraps a transient buffer (a serialization output, ato_vec(), an FFI argument) at the point where it is created. ItsDebugprints the inner value, so never format one.ZeroizeandZeroizeOnDropare for hand-written secret holders.
With the test-utils feature, heap_canary provides the test allocator
that proves a secret is wiped before its heap block is freed.
Structs§
- Secret
- Owned secret bytes. Wiped on drop;
Debugshows only the length. - Zeroizing
Zeroizingis a wrapper for anyZ: Zeroizetype which implements aDrophandler which zeroizes dropped values.
Traits§
- Zeroize
- Trait for securely erasing values from memory.
- Zeroize
OnDrop - Marker trait signifying that this type will
Zeroize::zeroizeitself onDrop.
Functions§
- deserialize_
seq - Read a
Secretstored as a sequence ofu8, the serde shape of aVec<u8>, into a wiping buffer. For a type whose shape another crate owns, such as OpenMLS’sSignatureKeyPair.
Derive Macros§
- Zeroize
- Derive the
Zeroizetrait. - Zeroize
OnDrop - Derive the
ZeroizeOnDroptrait.