}
macparams[0] =
- OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ALGORITHM,
+ OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST,
(char *)mdname, strlen(mdname) + 1);
macparams[1] =
OSSL_PARAM_construct_octet_string(OSSL_MAC_PARAM_KEY, basekey, bklen);
if (ctx->data != NULL) {
OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
- params[0] = OSSL_PARAM_construct_size_t(OSSL_MAC_PARAM_OUTLEN, &sz);
+ params[0] = OSSL_PARAM_construct_size_t(OSSL_MAC_PARAM_SIZE, &sz);
if (ctx->meth->get_ctx_params != NULL) {
if (ctx->meth->get_ctx_params(ctx->data, params))
return sz;
(char *)engine_name,
strlen(engine_name) + 1);
params[paramsn++] =
- OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ALGORITHM,
+ OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_CIPHER,
(char *)cipher_name,
strlen(cipher_name) + 1);
params[paramsn++] =
engineid,
strlen(engineid) + 1);
params[params_n++] =
- OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ALGORITHM,
+ OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_CIPHER,
ciphname,
strlen(ciphname) + 1);
params[params_n] = OSSL_PARAM_construct_end();
*/
params[0] =
- OSSL_PARAM_construct_size_t(OSSL_MAC_PARAM_OUTLEN, &size);
+ OSSL_PARAM_construct_size_t(OSSL_MAC_PARAM_SIZE, &size);
if (!EVP_MAC_CTX_set_params(hctx->ctx, params))
return 0;
params[0] =
- OSSL_PARAM_construct_size_t(OSSL_MAC_PARAM_OUTLEN, &verify);
+ OSSL_PARAM_construct_size_t(OSSL_MAC_PARAM_SIZE, &verify);
if (!EVP_MAC_CTX_get_params(hctx->ctx, params))
return 0;
engineid_l);
}
params[params_n++] =
- OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ALGORITHM,
+ OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST,
mdname,
strlen(mdname) + 1);
params[params_n++] =
OSSL_PARAM params[2];
int ok = 0;
+ /*
+ * Translation of some control names that are equivalent to a single
+ * parameter name.
+ *
+ * "md" and "digest" are the same thing, we use the single "digest"
+ *
+ * "digestsize" was a setting control in siphash, but naming wise,
+ * it's really the same as "size".
+ */
+ if (strcmp(type, "md") == 0)
+ type = OSSL_MAC_PARAM_DIGEST;
+ else if (strcmp(type, "digestsize") == 0)
+ type = OSSL_MAC_PARAM_SIZE;
+
if (!OSSL_PARAM_allocate_from_text(¶ms[0],
EVP_MAC_CTX_settable_params(mac),
type, value, strlen(value) + 1))
|| kmac_out_len == 64))
return 0;
- params[0] = OSSL_PARAM_construct_size_t(OSSL_MAC_PARAM_OUTLEN,
+ params[0] = OSSL_PARAM_construct_size_t(OSSL_MAC_PARAM_SIZE,
&kmac_out_len);
if (EVP_MAC_CTX_set_params(ctx, params) <= 0)
if (hmac_md != NULL) {
const char *mdname = EVP_MD_name(hmac_md);
params[params_n++] =
- OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ALGORITHM,
+ OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST,
(char *)mdname,
strlen(mdname) + 1);
}
/* TODO(3.0) rethink "flags", also see hmac.c in providers */
mac_flags = EVP_MD_CTX_FLAG_NON_FIPS_ALLOW;
params[0] = OSSL_PARAM_construct_int(OSSL_MAC_PARAM_FLAGS, &mac_flags);
- params[1] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ALGORITHM,
+ params[1] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST,
(char *)mdname,
strlen(mdname) + 1);
params[2] = OSSL_PARAM_construct_octet_string(OSSL_MAC_PARAM_KEY,
OSSL_PARAM params[3];
const char *cbc_name = EVP_CIPHER_name(cbc);
- params[0] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ALGORITHM,
+ params[0] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_CIPHER,
(char *)cbc_name,
strlen(cbc_name) + 1);
params[1] = OSSL_PARAM_construct_octet_string(OSSL_MAC_PARAM_KEY,
=for comment We need to investigate if this is the right approach
-=item B<OSSL_MAC_PARAM_ALGORITHM> (utf8 string)
-
-Sets the name of the underlying algorithm to be used.
-It must name a suitable algorithm for the MAC that's being used.
-
-=item B<OSSL_MAC_PARAM_MD> (utf8 string)
+=item B<OSSL_MAC_PARAM_CIPHER> (utf8 string)
=item B<OSSL_MAC_PARAM_DIGEST> (utf8 string)
-=item B<OSSL_MAC_PARAM_CIPHER> (utf8 string)
-
-These have the same meaning as B<OSSL_MAC_PARAM_ALGORITHM>, but specify
-the expected operation for the underlying algorithm.
-These are regarded as antiquated, but are kept for easier transition from
-legacy MAC implementations.
+Sets the name of the underlying cipher or digest to be used.
+It must name a suitable algorithm for the MAC that's being used.
=item B<OSSL_MAC_PARAM_ENGINE> (utf8 string)
=item B<OSSL_MAC_PARAM_SIZE> (int)
-=item B<OSSL_MAC_PARAM_DIGESTSIZE> (int)
-
-=item B<OSSL_MAC_PARAM_OUTLEN> (int)
+Can be used to get the resulting MAC size.
-All three names are considered the same.
-B<OSSL_MAC_PARAM_SIZE> and B<OSSL_MAC_PARAM_DIGESTSIZE> are considered
-antiquated, but are kept for easier transition from legacy MAC implementations.
+With some MAC algorithms, it can also be used to set the size that the
+resulting MAC should have.
+Allowable sizes are decided within each implementation.
=back
#define OSSL_MAC_PARAM_SALT "salt" /* octet string */
#define OSSL_MAC_PARAM_XOF "xof" /* int, 0 or 1 */
#define OSSL_MAC_PARAM_FLAGS "flags" /* int */
-/* Note that "md" and "digest" are equivalent */
-#define OSSL_MAC_PARAM_MD "md" /* utf8 string */
-#define OSSL_MAC_PARAM_DIGEST "digest" /* utf8 string */
+/*
+ * If "engine" or "properties" are specified, they should always be paired
+ * with "cipher" or "digest".
+ */
#define OSSL_MAC_PARAM_CIPHER "cipher" /* utf8 string */
-/* Note that "algorithm" can be used instead of "md", "digest" or "cipher" */
-#define OSSL_MAC_PARAM_ALGORITHM "algorithm" /* utf8 string */
+#define OSSL_MAC_PARAM_DIGEST "digest" /* utf8 string */
#define OSSL_MAC_PARAM_ENGINE "engine" /* utf8 string */
#define OSSL_MAC_PARAM_PROPERTIES "properties" /* utf8 string */
-/* Note that "size", "digestsize" and "outlen" are equivalent */
#define OSSL_MAC_PARAM_SIZE "size" /* size_t */
-#define OSSL_MAC_PARAM_DIGESTSIZE "digestsize" /* size_t */
-#define OSSL_MAC_PARAM_OUTLEN "outlen" /* size_t */
/* Known MAC names (not a complete list) */
#define OSSL_MAC_NAME_CMAC "CMAC"
}
static const OSSL_PARAM known_gettable_ctx_params[] = {
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_OUTLEN, NULL),
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL), /* Same as "outlen" */
+ OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
OSSL_PARAM_END
};
static const OSSL_PARAM *cmac_gettable_ctx_params(void)
{
OSSL_PARAM *p;
- if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_OUTLEN)) != NULL
- || (p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
+ if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
return OSSL_PARAM_set_size_t(p, cmac_size(vmacctx));
return 1;
}
static const OSSL_PARAM known_settable_ctx_params[] = {
- /* "algorithm" and "cipher" are the same parameter */
- OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_ALGORITHM, NULL, 0),
OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_CIPHER, NULL, 0),
OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_ENGINE, NULL, 0),
OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_PROPERTIES, NULL, 0),
struct cmac_data_st *macctx = vmacctx;
const OSSL_PARAM *p;
- if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_CIPHER)) != NULL
- || ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_ALGORITHM))
- != NULL)) {
+ if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_CIPHER)) != NULL) {
if (p->data_type != OSSL_PARAM_UTF8_STRING)
return 0;
/*
* Conditions for legacy EVP_CIPHER uses.
*/
- ENGINE *engine; /* Engine implementing the algorithm */
+ ENGINE *engine; /* Engine implementing the cipher */
};
static size_t gmac_size(void);
}
static const OSSL_PARAM known_gettable_params[] = {
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_OUTLEN, NULL),
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL), /* Same as "outlen" */
+ OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
OSSL_PARAM_END
};
static const OSSL_PARAM *gmac_gettable_params(void)
{
OSSL_PARAM *p;
- if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_OUTLEN)) != NULL
- || (p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
+ if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
return OSSL_PARAM_set_size_t(p, gmac_size());
return 1;
}
static const OSSL_PARAM known_settable_ctx_params[] = {
- /* "algorithm" and "cipher" are the same parameter */
- OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_ALGORITHM, NULL, 0),
OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_CIPHER, NULL, 0),
OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_ENGINE, NULL, 0),
OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_PROPERTIES, NULL, 0),
EVP_CIPHER_CTX *ctx = macctx->ctx;
const OSSL_PARAM *p;
- if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_CIPHER)) != NULL
- || (p = OSSL_PARAM_locate_const(params,
- OSSL_MAC_PARAM_ALGORITHM)) != NULL) {
+ if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_CIPHER)) != NULL) {
if (p->data_type != OSSL_PARAM_UTF8_STRING)
return 0;
}
static const OSSL_PARAM known_gettable_ctx_params[] = {
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_OUTLEN, NULL),
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL), /* Same as "outlen" */
+ OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
OSSL_PARAM_END
};
static const OSSL_PARAM *hmac_gettable_ctx_params(void)
{
OSSL_PARAM *p;
- if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_OUTLEN)) != NULL
- || (p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
+ if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
return OSSL_PARAM_set_size_t(p, hmac_size(vmacctx));
return 1;
}
static const OSSL_PARAM known_settable_ctx_params[] = {
- /* "algorithm" and "digest" are the same parameter */
- OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_ALGORITHM, NULL, 0),
OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_DIGEST, NULL, 0),
OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_ENGINE, NULL, 0),
OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_PROPERTIES, NULL, 0),
struct hmac_data_st *macctx = vmacctx;
const OSSL_PARAM *p;
- if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_DIGEST)) != NULL
- || (p = OSSL_PARAM_locate_const(params,
- OSSL_MAC_PARAM_ALGORITHM)) != NULL) {
+ if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_DIGEST)) != NULL) {
if (p->data_type != OSSL_PARAM_UTF8_STRING)
return 0;
}
static const OSSL_PARAM known_gettable_ctx_params[] = {
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_OUTLEN, NULL),
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL), /* Same as "outlen" */
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_DIGESTSIZE, NULL), /* Same as "outlen" */
+ OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
OSSL_PARAM_END
};
static const OSSL_PARAM *kmac_gettable_ctx_params(void)
{
OSSL_PARAM *p;
- if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_OUTLEN)) != NULL
- || (p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL
- || (p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_DIGESTSIZE)) != NULL)
+ if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
return OSSL_PARAM_set_size_t(p, kmac_size(vmacctx));
return 1;
static const OSSL_PARAM known_settable_ctx_params[] = {
OSSL_PARAM_int(OSSL_MAC_PARAM_XOF, NULL),
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_OUTLEN, NULL),
OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY, NULL, 0),
OSSL_PARAM_octet_string(OSSL_MAC_PARAM_CUSTOM, NULL, 0),
if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_XOF)) != NULL
&& !OSSL_PARAM_get_int(p, &kctx->xof_mode))
return 0;
- if (((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_OUTLEN)) != NULL
- ||
- (p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_SIZE)) != NULL)
+ if (((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_SIZE)) != NULL)
&& !OSSL_PARAM_get_size_t(p, &kctx->out_len))
return 0;
if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_KEY)) != NULL) {
}
static const OSSL_PARAM known_gettable_ctx_params[] = {
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_OUTLEN, NULL),
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL), /* Same as "outlen" */
+ OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
OSSL_PARAM_END
};
static const OSSL_PARAM *blake2_gettable_ctx_params(void)
{
OSSL_PARAM *p;
- if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_OUTLEN)) != NULL
- || (p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
+ if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
return OSSL_PARAM_set_size_t(p, blake2_mac_size(vmacctx));
return 1;
}
static const OSSL_PARAM known_settable_ctx_params[] = {
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_OUTLEN, NULL),
OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY, NULL, 0),
OSSL_PARAM_octet_string(OSSL_MAC_PARAM_CUSTOM, NULL, 0),
struct blake2_mac_data_st *macctx = vmacctx;
const OSSL_PARAM *p;
- if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_OUTLEN)) != NULL
- ||
- (p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_SIZE)) != NULL) {
+ if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_SIZE)) != NULL) {
size_t size;
if (!OSSL_PARAM_get_size_t(p, &size)
}
static const OSSL_PARAM known_gettable_params[] = {
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_OUTLEN, NULL),
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL), /* Same as "outlen" */
+ OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
OSSL_PARAM_END
};
static const OSSL_PARAM *poly1305_gettable_params(void)
{
OSSL_PARAM *p;
- if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_OUTLEN)) != NULL
- || (p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
+ if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
return OSSL_PARAM_set_size_t(p, poly1305_size());
return 1;
}
static const OSSL_PARAM known_gettable_ctx_params[] = {
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_OUTLEN, NULL),
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL), /* Same as "outlen" */
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_DIGESTSIZE, NULL), /* Same as "outlen" */
+ OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
OSSL_PARAM_END
};
static const OSSL_PARAM *siphash_gettable_ctx_params(void)
{
OSSL_PARAM *p;
- if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_OUTLEN)) != NULL
- || (p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL
- || (p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_DIGESTSIZE)) != NULL)
+ if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL)
return OSSL_PARAM_set_size_t(p, siphash_size(vmacctx));
return 1;
}
static const OSSL_PARAM known_settable_ctx_params[] = {
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_OUTLEN, NULL),
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL), /* Same as "outlen" */
- OSSL_PARAM_size_t(OSSL_MAC_PARAM_DIGESTSIZE, NULL), /* Same as "outlen" */
+ OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY, NULL, 0),
OSSL_PARAM_END
};
struct siphash_data_st *ctx = vmacctx;
const OSSL_PARAM *p = NULL;
- if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_OUTLEN)) != NULL
- || ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_DIGESTSIZE))
- != NULL)
- || ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_SIZE))
- != NULL)) {
+ if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_SIZE)) != NULL) {
size_t size;
if (!OSSL_PARAM_get_size_t(p, &size)
}
#endif
- if (expected->alg != NULL)
- params[params_n++] =
- OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ALGORITHM,
- expected->alg,
- strlen(expected->alg) + 1);
+ if (expected->alg != NULL) {
+ /*
+ * The underlying algorithm may be a cipher or a digest.
+ * We don't know which it is, but we can ask the MAC what it
+ * should be and bet on that.
+ */
+ if (OSSL_PARAM_locate_const(defined_params,
+ OSSL_MAC_PARAM_CIPHER) != NULL) {
+ params[params_n++] =
+ OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_CIPHER,
+ expected->alg,
+ strlen(expected->alg) + 1);
+ } else if (OSSL_PARAM_locate_const(defined_params,
+ OSSL_MAC_PARAM_DIGEST) != NULL) {
+ params[params_n++] =
+ OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST,
+ expected->alg,
+ strlen(expected->alg) + 1);
+ } else {
+ t->err = "MAC_BAD_PARAMS";
+ goto err;
+ }
+ }
if (expected->key != NULL)
params[params_n++] =
OSSL_PARAM_construct_octet_string(OSSL_MAC_PARAM_KEY,
# SIPHASH - default values: 2,4 rounds, explicit 8-byte mac
MAC = SipHash
-Ctrl = digestsize:8
+Ctrl = size:8
Key = 000102030405060708090A0B0C0D0E0F
Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E
Output = 724506EB4C328A95
# SIPHASH - default values: 2,4 rounds, explicit 16-byte mac
MAC = SipHash
-Ctrl = digestsize:16
+Ctrl = size:16
Key = 000102030405060708090A0B0C0D0E0F
Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E
Output = 5150d1772f50834a503e069a973fbd7c
# SIPHASH - default values: 2,4 rounds, explicit 16-byte mac (set as 0)
MAC = SipHash
-Ctrl = digestsize:0
+Ctrl = size:0
Key = 000102030405060708090A0B0C0D0E0F
Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E
Output = 5150d1772f50834a503e069a973fbd7c
# SIPHASH - default values: 2,4 rounds, explicit 13-byte mac (invalid size)
MAC = SipHash
-Ctrl = digestsize:13
+Ctrl = size:13
Key = 000102030405060708090A0B0C0D0E0F
Result = MAC_BAD_PARAMS
# by EVP_PKEY this time
MAC = SipHash by EVP_PKEY
-Ctrl = digestsize:13
+Ctrl = size:13
Key = 000102030405060708090A0B0C0D0E0F
Result = EVPPKEYCTXCTRL_ERROR
MAC = BLAKE2BMAC
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
-Ctrl = outlen:128
+Ctrl = size:128
Result = MAC_BAD_PARAMS
MAC = BLAKE2BMAC
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
Input = "Sample input for outlen<digest_length"
-Ctrl = outlen:1
+Ctrl = size:1
Output = 2a
MAC = BLAKE2BMAC
Key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
Input = "Sample input for outlen<digest_length"
-Ctrl = outlen:32
+Ctrl = size:32
Output = 7fa43c7735fcacad9fce2b44bef37dba6501ab48c9397bedb5562a682e519793
MAC = BLAKE2BMAC
Input = "Combo input with outlen, custom and salt"
Custom = "application"
Salt = 000102030405060708090a0b0c0d0e0f
-Ctrl = outlen:32
+Ctrl = size:32
Output = 51742fc491171eaf6b9459c8b93a44bbf8f44a0b4869a17fa178c8209918ad96
MAC = BLAKE2SMAC
MAC = BLAKE2SMAC
Key = 000102030405060708090a0b0c0d0e0f
-Ctrl = outlen:64
+Ctrl = size:64
Result = MAC_BAD_PARAMS
MAC = BLAKE2SMAC
Key = 000102030405060708090a0b0c0d0e0f
-Ctrl = outlen:16
+Ctrl = size:16
Input = "Sample input for outlen<digest_length"
Output = a09fb3d513efc3ed58dd1264de3c59f5
MAC = BLAKE2SMAC
Key = 000102030405060708090a0b0c0d0e0f
-Ctrl = outlen:16
+Ctrl = size:16
Custom = "app"
Salt = 0001020304050607
Input = "Combo input with outlen, custom and salt"
Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
Custom = "My Tagged Application"
Output = 1F5B4E6CCA02209E0DCB5CA635B89A15E271ECC760071DFD805FAA38F9729230
-Ctrl = outlen:32
+Ctrl = size:32
MAC = KMAC256
Key = 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F
Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
Custom = "My Tagged Application"
Output = B58618F71F92E1D56C1B8C55DDD7CD188B97B4CA4D99831EB2699A837DA2E4D970FBACFDE50033AEA585F1A2708510C32D07880801BD182898FE476876FC8965
-Ctrl = outlen:64
+Ctrl = size:64
Title = KMAC XOF Tests (From NIST)
Custom = "My Tagged Application"
Output = 47026C7CD793084AA0283C253EF658490C0DB61438B8326FE9BDDF281B83AE0F
Ctrl = xof:1
-Ctrl = outlen:32
+Ctrl = size:32
MAC = KMAC256
Key = 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F
Input = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
Custom = "My Tagged Application"
Output = D5BE731C954ED7732846BB59DBE3A8E30F83E77A4BFF4459F2F1C2B4ECEBB8CE67BA01C62E8AB8578D2D499BD1BB276768781190020A306A97DE281DCC30305D
-Ctrl = outlen:64
+Ctrl = size:64
Ctrl = xof:1