PQLR
Postquantum Crypto Library by QAPP
Polynomial hash algorithm

Typedefs

typedef struct polynomial_hash_st * polynomial_hash_t
 Polynomial Hash algorithm instance handle. More...
 

Functions

PQLR_API polynomial_hash_t polynomial_hash_new (uint32_t key_length)
 Creates polynomial hash instance. More...
 
PQLR_API void polynomial_hash_free (polynomial_hash_t polynomial_hash)
 Frees polynomial_hash instance and all corresponding resources. More...
 
PQLR_API uint32_t polynomial_hash_get_key_length_bits (polynomial_hash_t polynomial_hash)
 Obtains key length in bits for current polynomial_hash instance. More...
 
PQLR_API uint32_t polynomial_hash_get_hashtag_length_bits (polynomial_hash_t polynomial_hash)
 Obtains hashtag length in bits for current polynomial_hash instance. More...
 
PQLR_API uint32_t polynomial_hash_get_keys_length_bytes (polynomial_hash_t polynomial_hash)
 Obtains key length in bytes for current polynomial_hash instance. More...
 
PQLR_API uint32_t polynomial_hash_get_hashtag_length_bytes (polynomial_hash_t polynomial_hash)
 Obtains hashtag length in bytes for current polynomial_hash instance. More...
 
PQLR_API pqlr_t polynomial_hash_to_pqlr (polynomial_hash_t polynomial_hash)
 Casts polynomial_hash instance to pqlr instance. More...
 
PQLR_API void polynomial_hash_get_hash (const polynomial_hash_t polynomial_hash, const uint8_t *message, uint32_t message_length, const uint8_t *key, uint8_t *hash_tag)
 Returns the result of polynomial hashing. More...
 

Detailed Description

This module provides polynomial hash algorithm.

Typedef Documentation

◆ polynomial_hash_t

typedef struct polynomial_hash_st* polynomial_hash_t

Polynomial Hash algorithm instance handle.

Note
It could be casted to pqlr_t instance linked to this handle
See also
polynomial_hash_to_pqlr

Function Documentation

◆ polynomial_hash_free()

PQLR_API void polynomial_hash_free ( polynomial_hash_t  polynomial_hash)

Frees polynomial_hash instance and all corresponding resources.

Parameters
polynomial_hashinstance to free
See also
polynomial_hash_t
polynomial_hash_new

◆ polynomial_hash_get_hash()

PQLR_API void polynomial_hash_get_hash ( const polynomial_hash_t  polynomial_hash,
const uint8_t *  message,
uint32_t  message_length,
const uint8_t *  key,
uint8_t *  hash_tag 
)

Returns the result of polynomial hashing.

Parameters
polynomial_hashPolynomial hash algorithm context.
messageMessage to be hashed.
message_lengthThe length of the message
keyKey to be used for hashing.
[out]hash_tagResult hash tag.

Note that currently only 50bit keys are supported.

◆ polynomial_hash_get_hashtag_length_bits()

PQLR_API uint32_t polynomial_hash_get_hashtag_length_bits ( polynomial_hash_t  polynomial_hash)

Obtains hashtag length in bits for current polynomial_hash instance.

Parameters
polynomial_hashinitialized polynomial_hash instance
See also
polynomial_hash_t
polynomial_hash_new
Returns
encoded request length

◆ polynomial_hash_get_hashtag_length_bytes()

PQLR_API uint32_t polynomial_hash_get_hashtag_length_bytes ( polynomial_hash_t  polynomial_hash)

Obtains hashtag length in bytes for current polynomial_hash instance.

Parameters
polynomial_hashinitialized polynomial_hash instance
See also
polynomial_hash_t
polynomial_hash_new
Returns
encoded request length

◆ polynomial_hash_get_key_length_bits()

PQLR_API uint32_t polynomial_hash_get_key_length_bits ( polynomial_hash_t  polynomial_hash)

Obtains key length in bits for current polynomial_hash instance.

Parameters
polynomial_hashinitialized polynomial_hash instance
See also
polynomial_hash_t
polynomial_hash_new
Returns
initiator's secret length

◆ polynomial_hash_get_keys_length_bytes()

PQLR_API uint32_t polynomial_hash_get_keys_length_bytes ( polynomial_hash_t  polynomial_hash)

Obtains key length in bytes for current polynomial_hash instance.

Parameters
polynomial_hashinitialized polynomial_hash instance
See also
polynomial_hash_t
polynomial_hash_new
Returns
initiator's secret length

◆ polynomial_hash_new()

PQLR_API polynomial_hash_t polynomial_hash_new ( uint32_t  key_length)

Creates polynomial hash instance.

Parameters
key_lengthlength of the key to be used while hashing (in bits) (min 2bit, max 128bit)
See also
polynomial_hash_t
polynomial_hash_free
Returns
new polynomial_hash instance or NULL if out of memory

◆ polynomial_hash_to_pqlr()

PQLR_API pqlr_t polynomial_hash_to_pqlr ( polynomial_hash_t  polynomial_hash)

Casts polynomial_hash instance to pqlr instance.

Parameters
polynomial_hashinitialized polynomial hash instance
Note
this pqlr instance will be released by polynomial_hash_free
See also
polynomial_hash_t
pqlr_t
polynomial_hash_free
Returns
operable pqlr instance or NULL if polynominal_hash is NULL