23 #ifndef CRYPTO_NEWHOPE_h
24 #define CRYPTO_NEWHOPE_h
28 #define NEWHOPE_SENDABYTES 1824
29 #define NEWHOPE_SENDBBYTES 2048
30 #define NEWHOPE_SHAREDBYTES 32
43 uint16_t coeffs[1024];
62 Variant variant =
Ref,
const uint8_t *random_seed = 0);
63 static void sharedb(uint8_t shared_key[NEWHOPE_SHAREDBYTES],
64 uint8_t send[NEWHOPE_SENDBBYTES],
65 uint8_t received[NEWHOPE_SENDABYTES],
66 Variant variant =
Ref,
const uint8_t *random_seed = 0);
67 static void shareda(uint8_t shared_key[NEWHOPE_SHAREDBYTES],
69 uint8_t received[NEWHOPE_SENDBBYTES]);
The alternative "torref" version of the New Hope algorithm.
~NewHopePoly()
Clears sensitive data and destroys this "poly" object.
Variant
Describes the variant of the New Hope algorithm to implement.
NewHope post-quantum key exchange algorithm.
static void keygen(uint8_t send[NEWHOPE_SENDABYTES], NewHopePoly &sk, Variant variant=Ref, const uint8_t *random_seed=0)
Generates the key pair for Alice in a New Hope key exchange.
void clear()
Clears sensitive data in this "poly" object.
static void sharedb(uint8_t shared_key[NEWHOPE_SHAREDBYTES], uint8_t send[NEWHOPE_SENDBBYTES], uint8_t received[NEWHOPE_SENDABYTES], Variant variant=Ref, const uint8_t *random_seed=0)
Generates the public key and shared secret for Bob.
NewHopePoly()
Constructs a new "poly" object for the NewHope algorithm.
NewHope polynomial representation.
static void shareda(uint8_t shared_key[NEWHOPE_SHAREDBYTES], const NewHopePoly &sk, uint8_t received[NEWHOPE_SENDBBYTES])
Generates the shared secret for Alice.
The standard "reference" version of the New Hope algorithm.