make use of the crypto_tester in the crypto_factory
[strongswan.git] / src / libstrongswan / crypto / crypto_factory.h
index 6bf070c..f1ebcf9 100644 (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
@@ -222,9 +223,52 @@ struct crypto_factory_t {
        void (*remove_dh)(crypto_factory_t *this, dh_constructor_t create);
        
        /**
-     * Destroy a crypto_factory instance.
-     */
-    void (*destroy)(crypto_factory_t *this);
+        * Create an enumerator over all registered crypter algorithms.
+        *
+        * @return                              enumerator over encryption_algorithm_t
+        */
+       enumerator_t* (*create_crypter_enumerator)(crypto_factory_t *this);
+       
+       /**
+        * Create an enumerator over all registered signer algorithms.
+        *
+        * @return                              enumerator over integrity_algorithm_t
+        */
+       enumerator_t* (*create_signer_enumerator)(crypto_factory_t *this);
+       
+       /**
+        * Create an enumerator over all registered hasher algorithms.
+        *
+        * @return                              enumerator over hash_algorithm_t
+        */
+       enumerator_t* (*create_hasher_enumerator)(crypto_factory_t *this);
+       
+       /**
+        * Create an enumerator over all registered PRFs.
+        *
+        * @return                              enumerator over pseudo_random_function_t
+        */
+       enumerator_t* (*create_prf_enumerator)(crypto_factory_t *this);
+       
+       /**
+        * Create an enumerator over all registered diffie hellman groups.
+        *
+        * @return                              enumerator over diffie_hellman_group_t
+        */
+       enumerator_t* (*create_dh_enumerator)(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);
 };
 
 /**
@@ -232,4 +276,4 @@ struct crypto_factory_t {
  */
 crypto_factory_t *crypto_factory_create();
 
-#endif /* CRYPTO_FACTORY_H_ @}*/
+#endif /** CRYPTO_FACTORY_H_ @}*/