summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorToke Høiland-Jørgensen <toke@toke.dk>2021-04-10 17:33:28 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2021-06-06 16:26:58 +0200
commit725d9af94a6eaf3cbce1b107e36c8cf342828ea6 (patch)
tree5d7533ca9ba06ad1c836e70f9efbeeeaf6130d9b /nest
parente5724f71d2c054bc51d66092beb6af4da21e0c62 (diff)
Lib: Add Blake2s and Blake2b hash functions
The Babel MAC authentication RFC recommends implementing Blake2s as one of the supported algorithms. In order to achieve do this, add the blake2b and blake2s hash functions for MAC authentication. The hashing function implementations are the reference implementations from blake2.net. The Blake2 algorithms allow specifying an arbitrary output size, and the Babel MAC spec says to implement Blake2s with 128-bit output. To satisfy this, we add two different variants of each of the algorithms, one using the default size (256 bits for Blake2s, 512 bits for Blake2b), and one using half the default output size. Update to BIRD coding style done by committer.
Diffstat (limited to 'nest')
-rw-r--r--nest/config.Y6
1 files changed, 5 insertions, 1 deletions
diff --git a/nest/config.Y b/nest/config.Y
index 7b7f12cc..98820646 100644
--- a/nest/config.Y
+++ b/nest/config.Y
@@ -92,7 +92,7 @@ CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, VRF, DEFAULT, TABLE, STATES
CF_KEYWORDS(IPV4, IPV6, VPN4, VPN6, ROA4, ROA6, FLOW4, FLOW6, SADR, MPLS)
CF_KEYWORDS(RECEIVE, LIMIT, ACTION, WARN, BLOCK, RESTART, DISABLE, KEEP, FILTERED, RPKI)
CF_KEYWORDS(PASSWORD, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, CHANNELS, INTERFACES)
-CF_KEYWORDS(ALGORITHM, KEYED, HMAC, MD5, SHA1, SHA256, SHA384, SHA512)
+CF_KEYWORDS(ALGORITHM, KEYED, HMAC, MD5, SHA1, SHA256, SHA384, SHA512, BLAKE2S128, BLAKE2S256, BLAKE2B256, BLAKE2B512)
CF_KEYWORDS(PRIMARY, STATS, COUNT, BY, FOR, COMMANDS, PREEXPORT, NOEXPORT, EXPORTED, GENERATE)
CF_KEYWORDS(BGP, PASSWORDS, DESCRIPTION, SORTED)
CF_KEYWORDS(RELOAD, IN, OUT, MRTDUMP, MESSAGES, RESTRICT, MEMORY, IGP_METRIC, CLASS, DSCP)
@@ -532,6 +532,10 @@ password_algorithm:
| HMAC SHA256 { $$ = ALG_HMAC_SHA256; }
| HMAC SHA384 { $$ = ALG_HMAC_SHA384; }
| HMAC SHA512 { $$ = ALG_HMAC_SHA512; }
+ | BLAKE2S128 { $$ = ALG_BLAKE2S_128; }
+ | BLAKE2S256 { $$ = ALG_BLAKE2S_256; }
+ | BLAKE2B256 { $$ = ALG_BLAKE2B_256; }
+ | BLAKE2B512 { $$ = ALG_BLAKE2B_512; }
;