summaryrefslogtreecommitdiffstats
path: root/crypto_backend.h
diff options
context:
space:
mode:
authorAdriaan de Jong <dejong@fox-it.com>2011-06-23 16:21:32 +0200
committerDavid Sommerseth <davids@redhat.com>2011-10-19 22:09:54 +0200
commit902f674ef4170fd10cf47f216632e51214db6966 (patch)
treef1a952b61f862c83df9f133c1c5ef2e87c17bc69 /crypto_backend.h
parent4a5a6033f95369a2d94e2dafff1d702f82f118ba (diff)
downloadopenvpn-902f674ef4170fd10cf47f216632e51214db6966.tar.gz
openvpn-902f674ef4170fd10cf47f216632e51214db6966.tar.xz
openvpn-902f674ef4170fd10cf47f216632e51214db6966.zip
Refactored message digest type functions
Signed-off-by: Adriaan de Jong <dejong@fox-it.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'crypto_backend.h')
-rw-r--r--crypto_backend.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/crypto_backend.h b/crypto_backend.h
index 6c2bd0c..527f6b6 100644
--- a/crypto_backend.h
+++ b/crypto_backend.h
@@ -171,4 +171,37 @@ void cipher_des_encrypt_ecb (const unsigned char key[8],
*/
#define MAX_HMAC_KEY_LENGTH 64
+/**
+ * Return message digest parameters, based on the given digest name. The
+ * contents of these parameters are library-specific, and can be used to
+ * initialise HMAC or message digest operations.
+ *
+ * @param digest Name of the digest to retrieve parameters for (e.g.
+ * \c MD5).
+ *
+ * @return A statically allocated structure containing parameters
+ * for the given message digest.
+ */
+const md_kt_t * md_kt_get (const char *digest);
+
+/**
+ * Retrieve a string describing the digest digest (e.g. \c SHA1).
+ *
+ * @param kt Static message digest parameters
+ *
+ * @return Statically allocated string describing the message
+ * digest.
+ */
+const char * md_kt_name (const md_kt_t *kt);
+
+/**
+ * Returns the size of the message digest, in bytes.
+ *
+ * @param kt Static message digest parameters
+ *
+ * @return Message digest size, in bytes, or 0 if ctx was NULL.
+ */
+int md_kt_size (const md_kt_t *kt);
+
+
#endif /* CRYPTO_BACKEND_H_ */