extern int SIV_SetKey(SIV_Instance instance, const unsigned char *key, int length);
+extern int SIV_GetMinNonceLength(SIV_Instance instance);
+
+extern int SIV_GetMaxNonceLength(SIV_Instance instance);
+
extern int SIV_GetTagLength(SIV_Instance instance);
extern int SIV_Encrypt(SIV_Instance instance,
/* ================================================== */
+int
+SIV_GetMinNonceLength(SIV_Instance instance)
+{
+ return 1;
+}
+
+/* ================================================== */
+
+int
+SIV_GetMaxNonceLength(SIV_Instance instance)
+{
+ return INT_MAX;
+}
+
+/* ================================================== */
+
int
SIV_GetTagLength(SIV_Instance instance)
{
/* ================================================== */
+int
+SIV_GetMinNonceLength(SIV_Instance instance)
+{
+ return instance->min_nonce_length;
+}
+
+/* ================================================== */
+
+int
+SIV_GetMaxNonceLength(SIV_Instance instance)
+{
+ return instance->max_nonce_length;
+}
+
+/* ================================================== */
+
int
SIV_GetTagLength(SIV_Instance instance)
{
}
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,