Module Curve25519_51.Noalloc

Versions of these functions which write their output in a buffer passed in as an argument

val secret_to_public : sk:bytes -> pk:bytes -> unit

secret_to_public sk pk takes a 32-byte secret key sk and writes the corresponding 32-byte ECDH public key in pk. Buffers pk and sk must be distinct.

val ecdh : sk:bytes -> pk:bytes -> shared:bytes -> bool

ecdh sk pk shared takes a 32-byte secret key sk and another party's 32-byte public key and writes the 32-byte ECDH shared key in shared. Buffer shared must be distinct from pk and sk.

val scalarmult : scalar:bytes -> point:bytes -> result:bytes -> unit

scalarmult scalar point performs scalar multiplication over the curve. Buffers are 32-byte long and must be distinct.