EVP_F_EVP_MAC_CTX_COPY:211:EVP_MAC_CTX_copy
EVP_F_EVP_MAC_CTX_NEW:213:EVP_MAC_CTX_new
EVP_F_EVP_MAC_INIT:212:EVP_MAC_init
+EVP_F_EVP_MD_BLOCK_SIZE:229:EVP_MD_block_size
EVP_F_EVP_MD_CTX_COPY_EX:110:EVP_MD_CTX_copy_ex
EVP_F_EVP_MD_SIZE:162:EVP_MD_size
EVP_F_EVP_OPENINIT:102:EVP_OpenInit
break;
md->size = OSSL_get_OP_digest_size(fns);
break;
+ case OSSL_FUNC_DIGEST_BLOCK_SIZE:
+ if (md->dblock_size != NULL)
+ break;
+ md->dblock_size = OSSL_get_OP_digest_block_size(fns);
+ break;
}
}
if ((fncnt != 0 && fncnt != 5)
{ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_MAC_CTX_COPY, 0), "EVP_MAC_CTX_copy"},
{ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_MAC_CTX_NEW, 0), "EVP_MAC_CTX_new"},
{ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_MAC_INIT, 0), "EVP_MAC_init"},
+ {ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_MD_BLOCK_SIZE, 0), "EVP_MD_block_size"},
{ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_MD_CTX_COPY_EX, 0), "EVP_MD_CTX_copy_ex"},
{ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_MD_SIZE, 0), "EVP_MD_size"},
{ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_OPENINIT, 0), "EVP_OpenInit"},
int EVP_MD_block_size(const EVP_MD *md)
{
+ if (md == NULL) {
+ EVPerr(EVP_F_EVP_MD_BLOCK_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);
+ return -1;
+ }
+
+ if (md->prov != NULL && md->dblock_size != NULL)
+ return (int)md->dblock_size();
+
return md->block_size;
}
OSSL_OP_digest_freectx_fn *freectx;
OSSL_OP_digest_dupctx_fn *dupctx;
OSSL_OP_digest_size_fn *size;
+ OSSL_OP_digest_block_size_fn *dblock_size;
} /* EVP_MD */ ;
# define OSSL_FUNC_DIGEST_FREECTX 6
# define OSSL_FUNC_DIGEST_DUPCTX 7
# define OSSL_FUNC_DIGEST_SIZE 8
+# define OSSL_FUNC_DIGEST_BLOCK_SIZE 9
OSSL_CORE_MAKE_FUNC(void *, OP_digest_newctx, (void))
OSSL_CORE_MAKE_FUNC(int, OP_digest_init, (void *vctx))
OSSL_CORE_MAKE_FUNC(void, OP_digest_freectx, (void *vctx))
OSSL_CORE_MAKE_FUNC(void *, OP_digest_dupctx, (void *vctx))
OSSL_CORE_MAKE_FUNC(size_t, OP_digest_size, (void))
+OSSL_CORE_MAKE_FUNC(size_t, OP_digest_block_size, (void))
# ifdef __cplusplus
}
# define EVP_F_EVP_MAC_CTX_COPY 211
# define EVP_F_EVP_MAC_CTX_NEW 213
# define EVP_F_EVP_MAC_INIT 212
+# define EVP_F_EVP_MD_BLOCK_SIZE 229
# define EVP_F_EVP_MD_CTX_COPY_EX 110
# define EVP_F_EVP_MD_SIZE 162
# define EVP_F_EVP_OPENINIT 102
return SHA256_DIGEST_LENGTH;
}
+static size_t sha256_block_size(void)
+{
+ return SHA256_CBLOCK;
+}
+
extern const OSSL_DISPATCH sha256_functions[];
const OSSL_DISPATCH sha256_functions[] = {
{ OSSL_FUNC_DIGEST_NEWCTX, (void (*)(void))sha256_newctx },
{ OSSL_FUNC_DIGEST_FREECTX, (void (*)(void))sha256_freectx },
{ OSSL_FUNC_DIGEST_DUPCTX, (void (*)(void))sha256_dupctx },
{ OSSL_FUNC_DIGEST_SIZE, (void (*)(void))sha256_size },
+ { OSSL_FUNC_DIGEST_BLOCK_SIZE, (void (*)(void))sha256_block_size },
{ 0, NULL }
};