rokdocs
v0.1

rok::core::crypto::secret

Secret storage (2.21.5): a buffer in the large-object space, so the collector never moves or copies it, zeroed by wipe, by using release and by the collection that frees it (rok_gc_secret_new). Secret is the public byte form; SecretWords holds the algorithms' 32-bit key schedules and polynomials.

Structs

Secret

pub struct Secret

A fixed-length secret byte string. Copies share the bytes.

  • pub fn zeroed(len: usize) -> Secret

    len zero bytes.

  • pub fn new(bytes: Bytes) -> Secret

    A copy of bytes.

  • pub const fn len(self) -> usize
  • pub const fn as_bytes(self) -> Slice<u8>

    The bytes where they are, not a copy: a view reads zeros once the secret is wiped.

  • pub fn wipe(self)

    Overwrite the bytes with zeros now; every copy and view sees it.

Trait implementations 6
  • impl !Sync for Secret
  • impl Index<usize> for Secret
  • impl IndexSet<usize> for Secret
  • impl Sliceable<Range<usize>> for Secret
  • impl Drop for Secret
  • impl Debug for Secret