PQLR  v1.4-86-c274fcf7
Postquantum Crypto Library by QAPP
newhope.h File Reference
#include "params.h"
#include <pqlr/common/pqlr.h>
#include <pqlr/common/api.h>
#include <stdint.h>

Go to the source code of this file.

Typedefs

typedef struct newhope_st * newhope_t
 Newhope algorithm instance handle. More...
 

Enumerations

enum  newhope_parameterset_t { newhope_1024, newhope_last }
 Possible newhope parameters sets. More...
 

Functions

PQLR_API newhope_t newhope_new (newhope_parameterset_t parameterset)
 Creates newhope instance initialized by parameterset. More...
 
PQLR_API void newhope_free (newhope_t newhope)
 Frees newhope instance and all corresponding resources. More...
 
PQLR_API newhope_t newhope_duplicate (const newhope_t newhope)
 Duplicates context of newhope instance. More...
 
PQLR_API uint32_t newhope_get_initiator_secret_length (newhope_t newhope)
 Obtains initiator's secret length for current newhope instance. More...
 
PQLR_API uint32_t newhope_get_encoded_request_length (newhope_t newhope)
 Obtains encoded request length for current newhope instance. More...
 
PQLR_API uint32_t newhope_get_encoded_reply_length (newhope_t newhope)
 Obtains encoded reply length for current newhope instance. More...
 
PQLR_API uint32_t newhope_get_keybytes_num (newhope_t newhope)
 Obtains number of symmetric secret key bytes for current newhope instance. More...
 
PQLR_API pqlr_t newhope_to_pqlr (newhope_t newhope)
 Casts newhope instance to pqlr instance. More...
 
PQLR_API void newhope_initiator_prepare (const newhope_t newhope, newhope_poly_t *secret, uint8_t *encoded_request)
 Initial step of key distribution. Generates private secret for key distribution initiator. More...
 
PQLR_API void newhope_responder (const newhope_t newhope, const uint8_t *encoded_request, uint8_t *encoded_reply, uint8_t *key)
 Second step of key distribution. Generates symmetric secret key on responder side (opposite from initiator). More...
 
PQLR_API void newhope_initiator_finalize (const newhope_t newhope, const newhope_poly_t *secret, const uint8_t *encoded_reply, uint8_t *key)
 Last step of key distribution. Generates symmetric secret key on initiator side. More...