abla/crypto/ed25519

Generated from source.

Import with import "abla/crypto/ed25519".

Source: abla/crypto/ed25519/entry.ab

Re-exports abla/crypto/result.

ed25519PublicKey (fun)

fun ed25519PublicKey(seed: string): CryptoResult

The public key (32 bytes) of a private key (a 32-byte seed): RFC 8032 section 5.1.5.

ed25519Sign (fun)

fun ed25519Sign(seed: string, message: string): CryptoResult

The signature (64 bytes) of message under the private key seed (32 bytes): RFC 8032 section 5.1.6. Deterministic: the same seed and message give the same signature.

ed25519SignWithPublicKey (fun)

fun ed25519SignWithPublicKey(seed: string, publicKey: string, message: string): CryptoResult

As ed25519Sign, with the public key of seed already in hand (ed25519PublicKey(seed), 32 bytes: it is public, so a holder of the key keeps it and saves the multiplication of the base point that recomputing it costs, about half of a signature). A public key that is not the seed's gives a signature that does not verify.

ed25519Verify (fun)

fun ed25519Verify(publicKey: string, message: string, signature: string): bool

Whether signature (64 bytes) is publicKey's signature of message: RFC 8032 section 5.1.7. The check is the strict one: S is below L, the public key is a point with a canonical encoding, and the encoding of [S]B - [k]A is R's bytes (so R is canonical and the cofactor is not cleared). A public key of small order (order 1, 2, 4 or 8: eight times it is the identity) is refused: it verifies a signature of any message made with no secret. Everything here is public: the doublings are shared by the two scalars, in windows of four bits.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.