Module Rfc7748.X448
X448 (based on Ed448-Goldilocks by Mike Hamburg)
This curve is considered to have a strength equivalent to 224 bit in a symmetric cipher. It was proposed in Ed448-Goldilocks by Mike Hamburg.
Types
Constants
val base : public_keyThe base point of the curve.
Key Conversion
val public_key_of_string : string -> public_keyCreate a public key from a given string. The key is assumed to be encoded in hexadecimal and must have a length of
2*key_size. The string is silently truncated (if too long) or padded (if too short). An exception is raised if the string contains characters that are not valid hexadecimal digits. The curves in RFC 7748 are specially crafted such that public keys received from untrusted sources can be used safely without validation.Note that the creation includes a canonicalization step and thus, in general,
string_of_public_key (public_key_of_string s) <> s.
val private_key_of_string : string -> private_keyCreate a private key from a given string. The key is assumed to be encoded in hexadecimal and must have a length of
2*key_size. The string is silently truncated (if too long) or padded (if too short). An exception is raised if the string contains characters that are not valid hexadecimal digits. The curves in RFC 7748 are specially crafted such that any random sequence of bytes of the correct length can be used to create a private key.Note that the creation includes a canonicalization step and thus, in general,
string_of_private_key (private_key_of_string s) <> s.
val string_of_public_key : public_key -> stringConvert the public key to its hex-encoded string representation.
val string_of_private_key : private_key -> stringConvert the private key to its hex-encoded string representation.
val public_key_of_bytes : Stdlib.Bytes.t -> public_keyCreate a public key from a byte array of length
key_size. An exception is raised if the array has the wrong size. Besides that, the function behaves likepublic_key_of_stringafter hex-decoding. The array is not modified by this module, and it must not be modified externally while thepublic_keyobject is in scope.
val private_key_of_bytes : Stdlib.Bytes.t -> private_keyCreate a private key from a byte array of length
key_size. An exception is raised if the array has the wrong size. Besides that, the function behaves likeprivate_key_of_stringafter hex-decoding. The array is not modified by this module, and it must not be modified externally while thepublic_keyobject is in scope.
val bytes_of_public_key : public_key -> Stdlib.Bytes.tCreate a byte array from the given public key.
val bytes_of_private_key : private_key -> Stdlib.Bytes.tCreate a byte array from the given private key.
Curve Operations
val scale : private_key -> public_key -> public_keyscale priv pubis the scalar multiplication ofpubbypriv.
val public_key_of_private_key : private_key -> public_keypublic_key_of_private_key privis equal toscale priv base