* Keyed hash functions::
* Key derivation functions::
* Public-key algorithms::
+* Key-Encapsulation mechanisms::
* Randomness::
* ASCII encoding::
* Miscellaneous functions::
* Keyed hash functions::
* Key derivation functions::
* Public-key algorithms::
+* Key-Encapsulation mechanisms::
* Randomness::
* ASCII encoding::
* Miscellaneous functions::
signature is valid, otherwise 0.
@end deftypefun
+@node Key-Encapsulation mechanisms
+@section Key-Encapsulation mechanisms
+
+@cindex Key-Encapsulation mechanisms
+@cindex KEM
+@cindex sntrup
+
+Key-Encapsulation mechanisms allows a sender to take a public key as
+input and produce (encapsulate) a session key wrapped in ciphertext, and
+the receiver to extract (decapsulate) the session key using its private
+key.
+
+Nettle supports the Streamlined NTRU Prime algorithm @code{sntrup761}.
+
+Nettle defines sntrup761 in @file{<nettle/sntrup.h>}.
+
+@defvr Constant SNTRUP761_PRIVATE_KEY_SIZE
+The size (1763 bytes) of the sntrup761 secret key.
+@end defvr
+
+@defvr Constant SNTRUP761_PUBLIC_KEY_SIZE
+The size (1158 bytes) of the sntrup761 secret key.
+@end defvr
+
+@defvr Constant SNTRUP761_CIPHER_SIZE
+The size (1039 bytes) of the sntrup761 ciphertext.
+@end defvr
+
+@defvr Constant SNTRUP_SESSION_KEY_SIZE
+The size (32 bytes) of the sntrup output session key.
+@end defvr
+
+@deftypefun void sntrup761_generate_keypair (uint8_t *@var{pk}, uint8_t *@var{sk}, void *@var{random_ctx}, nettle_random_func *@var{random});
+Generate a sntrup761 public key @var{pk} and private key @var{sk}, using
+randomness-generator @var{random} with context @var{random_ctx}.
+@end deftypefun
+
+@deftypefun void sntrup761_encap (const uint8_t *@var{pk}, uint8_t *@var{k}, uint8_t *@var{c}, void *@var{random_ctx}, nettle_random_func *@var{random});
+Generate a session key @var{k} and encapsulate it into ciphertext
+@var{c} for the recipient with public-key @var{pk}, using
+randomness-generator @var{random} with context @var{random_ctx}.
+@end deftypefun
+
+@deftypefun void sntrup761_decap (const uint8_t *@var{sk}, uint8_t *@var{k}, const uint8_t *@var{c});
+Decapsulate session key @var{k} from ciphertext @var{c} using the
+private key @var{sk}.
+@end deftypefun
+
@node Randomness
@section Randomness