drbg: Implemented NIST SP-800-90A DRBG
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Martin Willi
|
||||
* Copyright (C) 2016-2019 Andreas Steffen
|
||||
* HSR Hochschule fuer Technik Rapperswil
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
@@ -31,6 +32,7 @@ typedef struct signer_test_vector_t signer_test_vector_t;
|
||||
typedef struct hasher_test_vector_t hasher_test_vector_t;
|
||||
typedef struct prf_test_vector_t prf_test_vector_t;
|
||||
typedef struct xof_test_vector_t xof_test_vector_t;
|
||||
typedef struct drbg_test_vector_t drbg_test_vector_t;
|
||||
typedef struct rng_test_vector_t rng_test_vector_t;
|
||||
typedef struct dh_test_vector_t dh_test_vector_t;
|
||||
|
||||
@@ -128,6 +130,19 @@ struct xof_test_vector_t {
|
||||
u_char *out;
|
||||
};
|
||||
|
||||
struct drbg_test_vector_t {
|
||||
/** drbg type this test vector tests */
|
||||
drbg_type_t type;
|
||||
/** security strength in bits */
|
||||
uint32_t strength;
|
||||
/** optional personalization string */
|
||||
chunk_t personalization_str;
|
||||
/** entropy_input | nonce | entropy_input_reseed */
|
||||
chunk_t entropy;
|
||||
/** returned output bits */
|
||||
chunk_t out;
|
||||
};
|
||||
|
||||
/**
|
||||
* Test vector for a RNG.
|
||||
*
|
||||
@@ -241,6 +256,17 @@ struct crypto_tester_t {
|
||||
bool (*test_xof)(crypto_tester_t *this, ext_out_function_t alg,
|
||||
xof_constructor_t create,
|
||||
u_int *speed, const char *plugin_name);
|
||||
/**
|
||||
* Test a DRBG type.
|
||||
*
|
||||
* @param type DRBG type to test
|
||||
* @param create constructor function for the DRBG
|
||||
* @param speed speed test result, NULL to omit
|
||||
* @return TRUE if test passed
|
||||
*/
|
||||
bool (*test_drbg)(crypto_tester_t *this, drbg_type_t type,
|
||||
drbg_constructor_t create,
|
||||
u_int *speed, const char *plugin_name);
|
||||
/**
|
||||
* Test a RNG implementation.
|
||||
*
|
||||
@@ -306,6 +332,13 @@ struct crypto_tester_t {
|
||||
*/
|
||||
void (*add_xof_vector)(crypto_tester_t *this, xof_test_vector_t *vector);
|
||||
|
||||
/**
|
||||
* Add a test vector to test a DRBG.
|
||||
*
|
||||
* @param vector pointer to test vector
|
||||
*/
|
||||
void (*add_drbg_vector)(crypto_tester_t *this, drbg_test_vector_t *vector);
|
||||
|
||||
/**
|
||||
* Add a test vector to test a RNG.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user