Sign in

    moonbitstack/mooncrypt/sign/ed25519 does not have a README file

    PrivateKey

    type PrivateKey

    An Ed25519 signing key: the 32-byte secret seed, not the expanded scalar.

    RFC 8032 calls the seed the private key and derives everything else from it, which is why a key file holds 32 bytes and not 64.

    PrivateKey::bytes

    fn PrivateKey::bytes(self : PrivateKey) -> Bytes

    The secret this key was built from — the 32-byte seed for a key from [PrivateKey::new], and whatever was handed to [PrivateKey::of_secret] otherwise.

    PrivateKey::new

    Read a signing key from its 32-byte seed.

    PrivateKey::of_secret

    fn PrivateKey::of_secret(secret : BytesView) -> PrivateKey

    A signing key from a secret of any length.

    [PrivateKey::new] takes the 32-byte seed the key format stores. The expansion itself — SHA-512 over the secret, then clamping — is defined for an input of any length; RFC 8032 fixes the seed at 32 octets so that keys have one written form, not because the arithmetic needs it. MariaDB's client_ed25519 keys a connection with the password directly, which is the protocol this entry point exists for.

    Anything that holds a real seed wants new: it is the one that refuses a secret of the wrong length, and a length check is worth having.

    PrivateKey::public

    fn PrivateKey::public(self : PrivateKey) -> PublicKey

    The verification key that matches this signing key: A = [s]B.

    PrivateKey::sign

    fn PrivateKey::sign(self : PrivateKey, msg : BytesView) -> Bytes

    PublicKey

    type PublicKey

    An Ed25519 verification key: a point on Edwards25519 in its 32-byte compressed form.

    PublicKey::bytes

    fn PublicKey::bytes(self : PublicKey) -> Bytes

    The 32 bytes this key is written as.

    PublicKey::new

    Read a public key from its 32 compressed bytes.

    PublicKey::verify

    fn PublicKey::verify(self : PublicKey, msg : BytesView, sig : BytesView) -> Bool

    key_size

    let key_size : Int

    The length of a seed, a public key and half a signature.

    sig_size

    let sig_size : Int

    The length of a signature: R ∥ S.

    Source Files