sync with OpenBSD -current

This commit is contained in:
purplerain 2024-03-02 19:33:09 +00:00
parent efa57bf0d2
commit d178ff6848
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
153 changed files with 982 additions and 11182 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: cmac.c,v 1.22 2024/01/30 17:43:39 tb Exp $ */
/* $OpenBSD: cmac.c,v 1.23 2024/03/02 09:30:21 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
@ -323,18 +323,3 @@ CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen)
return 1;
}
LCRYPTO_ALIAS(CMAC_Final);
int
CMAC_resume(CMAC_CTX *ctx)
{
if (ctx->nlast_block == -1)
return 0;
/* The buffer "tbl" containes the last fully encrypted block
* which is the last IV (or all zeroes if no last encrypted block).
* The last block has not been modified since CMAC_final().
* So reinitialising using the last decrypted block will allow
* CMAC to continue after calling CMAC_Final().
*/
return EVP_EncryptInit_ex(ctx->cipher_ctx, NULL, NULL, NULL, ctx->tbl);
}
LCRYPTO_ALIAS(CMAC_resume);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: cmac.h,v 1.3 2014/06/21 13:42:14 jsing Exp $ */
/* $OpenBSD: cmac.h,v 1.4 2024/03/02 09:30:21 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
@ -74,7 +74,6 @@ int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
const EVP_CIPHER *cipher, ENGINE *impl);
int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen);
int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen);
int CMAC_resume(CMAC_CTX *ctx);
#ifdef __cplusplus
}