docs

你正在阅读 v0.1.0 的文档。Nabi 0.1.0 已不再提供支持。 最新版本:v0.1.3 →

core::crypto::secret

本页内容

API 参考只有英文版,由标准库源代码中的英文文档注释生成。

Secret storage: 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 (nabi_gc_secret_new). Secret is the public byte form; SecretWords holds the algorithms' 32-bit key schedules and polynomials.

Structs

SecretSource

pub struct Secret

A fixed-length secret byte string. It has one owner (let b = a moves it), and is wiped where it is released.

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

    Source

    len zero bytes.

  • pub fn new<B: AsBytes>(bytes: B) -> Secret§

    Source

    A copy of bytes.

  • pub const fn len(self) -> usize§

    Source

    The number of bytes.

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

    Source

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

  • pub fn wipe(self)§

    Source

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

Trait implementations 8