mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-06 11:05:06 -05:00
siv: add functions to return min and max nonce length
While AES-SIV-CMAC allows nonces of any length, AES-GCM-SIV requires exactly 12 bytes, which is less than the unpadded minimum length of 16 used in the NTS authenticator field. These functions will be needed to support both ciphers in the NTS code.
This commit is contained in:
@@ -244,6 +244,12 @@ test_unit(void)
|
||||
}
|
||||
|
||||
TEST_CHECK(SIV_GetKeyLength(tests[i].algorithm) == tests[i].key_length);
|
||||
TEST_CHECK(SIV_GetMinNonceLength(siv) >= 1);
|
||||
TEST_CHECK(SIV_GetMinNonceLength(siv) <= 12);
|
||||
TEST_CHECK(SIV_GetMaxNonceLength(siv) >= 12);
|
||||
TEST_CHECK(SIV_GetMinNonceLength(siv) <= SIV_GetMaxNonceLength(siv));
|
||||
if (fixed_nonce_length)
|
||||
TEST_CHECK(SIV_GetMinNonceLength(siv) == SIV_GetMaxNonceLength(siv));
|
||||
|
||||
r = SIV_Encrypt(siv, tests[i].nonce, tests[i].nonce_length,
|
||||
tests[i].assoc, tests[i].assoc_length,
|
||||
|
||||
Reference in New Issue
Block a user