From 902f674ef4170fd10cf47f216632e51214db6966 Mon Sep 17 00:00:00 2001 From: Adriaan de Jong Date: Thu, 23 Jun 2011 16:21:32 +0200 Subject: Refactored message digest type functions Signed-off-by: Adriaan de Jong Acked-by: David Sommerseth Signed-off-by: David Sommerseth --- crypto_backend.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'crypto_backend.h') 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_ */ -- cgit