module

Beryl::Crypto::V1::EdwardsCurveSignaturesOverCurve25519

Ed25519 signatures (RFC 8032 §5.1), the pure variant without context.

signing_key = Beryl::Crypto::V1::Ed25519::SigningKey.generate
signature = signing_key.sign("a message")                   # 64 bytes
signing_key.verification_key.verify("a message", signature) # => true

Key generation and signing multiply the base point by a secret scalar in constant time. Verification is variable time (every input is public) and strict: it refuses S >= L and a public key whose encoding is not canonical or not on the curve (RFC 8032 §5.1.7). It checks [S]B = R + [k]A without the cofactor by comparing the encoding of [S]B - [k]A with R, as ref10 and OpenSSL do; that encoding is always canonical, so an R that is not is refused by the comparison itself.

Constants

PUBLIC_BYTESIZE = 32
SEED_BYTESIZE = 32
SIGNATURE_BYTESIZE = 64

Nested types