summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/xcbc/xcbc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/plugins/xcbc/xcbc.h')
-rw-r--r--src/libstrongswan/plugins/xcbc/xcbc.h60
1 files changed, 15 insertions, 45 deletions
diff --git a/src/libstrongswan/plugins/xcbc/xcbc.h b/src/libstrongswan/plugins/xcbc/xcbc.h
index 5d5eb04fb..a36069a17 100644
--- a/src/libstrongswan/plugins/xcbc/xcbc.h
+++ b/src/libstrongswan/plugins/xcbc/xcbc.h
@@ -14,6 +14,11 @@
*/
/**
+ * Message authentication using CBC crypter.
+ *
+ * This class implements the message authentication algorithm
+ * described in RFC3566.
+ *
* @defgroup xcbc xcbc
* @{ @ingroup xcbc_p
*/
@@ -21,58 +26,23 @@
#ifndef XCBC_H_
#define XCBC_H_
-typedef struct xcbc_t xcbc_t;
-
-#include <crypto/hashers/hasher.h>
+#include <crypto/prfs/prf.h>
+#include <crypto/signers/signer.h>
/**
- * Message authentication using CBC crypter.
+ * Creates a new prf_t object based on a XCBC MAC.
*
- * This class implements the message authentication algorithm
- * described in RFC3566.
+ * @param algo algorithm to implement
+ * @return prf_t object, NULL if not supported
*/
-struct xcbc_t {
-
- /**
- * Generate message authentication code.
- *
- * If buffer is NULL, no result is given back. A next call will
- * append the data to already supplied data. If buffer is not NULL,
- * the mac of all apended data is calculated, returned and the
- * state of the xcbc_t is reseted.
- *
- * @param data chunk of data to authenticate
- * @param buffer pointer where the generated bytes will be written
- */
- void (*get_mac) (xcbc_t *this, chunk_t data, u_int8_t *buffer);
-
- /**
- * Get the block size of this xcbc_t object.
- *
- * @return block size in bytes
- */
- size_t (*get_block_size) (xcbc_t *this);
-
- /**
- * Set the key for this xcbc_t object.
- *
- * @param key key to set
- */
- void (*set_key) (xcbc_t *this, chunk_t key);
-
- /**
- * Destroys a xcbc_t object.
- */
- void (*destroy) (xcbc_t *this);
-};
+prf_t *xcbc_prf_create(pseudo_random_function_t algo);
/**
- * Creates a new xcbc_t object.
+ * Creates a new signer_t object based on a XCBC MAC.
*
- * @param algo underlying crypto algorithm
- * @param key_size key size to use, if required for algorithm
- * @return xcbc_t object, NULL if not supported
+ * @param algo algorithm to implement
+ * @return signer_t, NULL if not supported
*/
-xcbc_t *xcbc_create(encryption_algorithm_t algo, size_t key_size);
+signer_t *xcbc_signer_create(integrity_algorithm_t algo);
#endif /** XCBC_H_ @}*/