docs

v0.1.2 문서를 보고 있습니다. 이 버전은 더 이상 지원하지 않습니다. 최신 릴리스: 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