aboutsummaryrefslogtreecommitdiff
path: root/crypto/hmac.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-03-22 16:44:03 +0100
committerToni Uhlig <matzeton@googlemail.com>2023-03-22 16:44:03 +0100
commitaa83760418f5ed5ce35a9add6517b2ca98ccb5bd (patch)
tree784d5e108ea31e20c5183cc9508d695f35e626bc /crypto/hmac.h
parentba6815ef8fb8ae472412b5af2837a7caba2799c2 (diff)
Add crypto sources for future use.add/crypto
* the goal is to support AES-CBC-HMAC-SHA as AEAD cipher Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'crypto/hmac.h')
-rw-r--r--crypto/hmac.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/crypto/hmac.h b/crypto/hmac.h
new file mode 100644
index 0000000..2c2d437
--- /dev/null
+++ b/crypto/hmac.h
@@ -0,0 +1,22 @@
+#ifndef __HMAC_H__
+#define __HMAC_H__
+
+#include <stdint.h>
+#include "sha1.h"
+
+#define HMAC_SHA1_HASH_SIZE 20
+
+/***********************************************************************'
+ * HMAC(K,m) : HMAC SHA1
+ * @param key : secret key
+ * @param keysize : key-length ín bytes
+ * @param msg : msg to calculate HMAC over
+ * @param msgsize : msg-length in bytes
+ * @param output : writeable buffer with at least 20 bytes available
+ */
+void hmac_sha1(const uint8_t* key, const uint32_t keysize, const uint8_t* msg, const uint32_t msgsize, uint8_t* output);
+
+
+#endif /* __HMAC_H__ */
+
+