docs

v0.1.0 문서를 보고 있습니다. 이 버전은 더 이상 지원하지 않습니다. 최신 릴리스: v0.1.3 →

core::crypto::ed25519

이 페이지의 내용

API 참조는 영어로만 있습니다. 표준 라이브러리 소스의 영어 문서 주석에서 만듭니다.

Ed25519 (RFC 8032 5.1): pure EdDSA over edwards25519 with SHA-512.

Structs

SigningKeySource

pub struct SigningKey

A signing key: the 32-byte seed and its expansion, in secret storage. It has one owner (let b = a moves it); wipe and its release clear it.

  • pub fn from_seed<B: AsBytes>(seed: B) throws (ValueError) -> SigningKey§

    Source

    The key of a 32-byte seed.

  • pub fn seed(self) -> Secret§

    Source

    A copy of the seed.

  • pub const fn verifying_key(self) -> VerifyingKey§

    Source

    The public key that checks this key's signatures.

  • pub fn sign<B: AsBytes>(self, msg: B) -> List<u8>§

    Source

    The 64-byte signature R || S of msg (deterministic).

  • pub fn wipe(self)§

    Source

    Overwrite the key material with zeros now (every copy shares it); sign is meaningless afterwards.

Trait implementations 3
  • impl !Sync for SigningKey
  • impl Drop for SigningKey
  • impl Debug for SigningKey

VerifyingKeySource

pub struct VerifyingKey

A public key: a 32-byte encoded point.

  • pub fn from_bytes<B: AsBytes>(bytes: B) throws (ValueError) -> VerifyingKey§

    Source

    A 32-byte encoded point; a non-canonical encoding or one that is not on the curve is an error.

  • pub const fn to_bytes(self) -> [u8; 32]§

    Source

    The key's 32 bytes.

  • pub fn verify<M: AsBytes, S: AsBytes>(self, msg: M, sig: S) -> bool§

    Source

    Whether sig is a valid signature of msg: S < L and the encoding of [S]B - [k]A equal to R byte for byte (cofactorless, RFC 8032 5.1.7).