make use of the crypto_tester in the crypto_factory

libstrongswan.crypto.test.on_add to test algorithms during initialization
libstrongswan.crypto.test.on_create to test algorithms on each instantiation
This commit is contained in:
Martin Willi
2009-06-11 15:55:48 +02:00
parent 3e8891667b
commit 28a0728b67
3 changed files with 149 additions and 44 deletions
+12 -3
View File
@@ -30,6 +30,7 @@ typedef struct crypto_factory_t crypto_factory_t;
#include <crypto/prfs/prf.h>
#include <crypto/rngs/rng.h>
#include <crypto/diffie_hellman.h>
#include <crypto/transform.h>
/**
* Constructor function for crypters
@@ -257,9 +258,17 @@ struct crypto_factory_t {
enumerator_t* (*create_dh_enumerator)(crypto_factory_t *this);
/**
* Destroy a crypto_factory instance.
*/
void (*destroy)(crypto_factory_t *this);
* Add a test vector to the crypto factory.
*
* @param type type of the test vector
* @param ... pointer to a test vector, defined in crypto_tester.h
*/
void (*add_test_vector)(crypto_factory_t *this, transform_type_t type, ...);
/**
* Destroy a crypto_factory instance.
*/
void (*destroy)(crypto_factory_t *this);
};
/**