]> git.ipfire.org Git - thirdparty/bird.git/blobdiff - lib/mac.h
Merge remote-tracking branch 'origin/master' into mq-filter-stack
[thirdparty/bird.git] / lib / mac.h
index 9dba8f899296d55e153d6054312b991951318f01..b6f3af5229c274bac247f01b539b1a857b9e2326 100644 (file)
--- a/lib/mac.h
+++ b/lib/mac.h
@@ -21,6 +21,7 @@
 #define ALG_SHA256             0x04
 #define ALG_SHA384             0x05
 #define ALG_SHA512             0x06
+#define ALG_HMAC               0x10
 #define ALG_HMAC_MD5           0x11
 #define ALG_HMAC_SHA1          0x12
 #define ALG_HMAC_SHA224                0x13
@@ -34,6 +35,9 @@
 #define HASH_STORAGE           sizeof(struct sha512_context)
 #define MAC_STORAGE            sizeof(struct hmac_context)
 
+/* This value is used by several IETF protocols for padding */
+#define HMAC_MAGIC             htonl(0x878FE1F3)
+
 /* Generic context used by hash functions */
 struct hash_context
 {
@@ -85,7 +89,7 @@ struct mac_desc {
   byte *(*hash_final)(struct hash_context *ctx);
 };
 
-const struct mac_desc mac_table[ALG_MAX];
+extern const struct mac_desc mac_table[ALG_MAX];
 
 static inline const char *mac_type_name(uint id)
 { return mac_table[id].name; }