]> git.ipfire.org Git - thirdparty/openssl.git/blame - providers/implementations/digests/blake2_prov.c
Make the naming scheme for dispatched functions more consistent
[thirdparty/openssl.git] / providers / implementations / digests / blake2_prov.c
CommitLineData
d5e5e2ff
SL
1/*
2 * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#include <openssl/crypto.h>
7c214f10
RL
11#include "prov/blake2.h"
12#include "prov/digestcommon.h"
af3e7e1b 13#include "prov/implementations.h"
d5e5e2ff 14
363b1e5d
DMSP
15OSSL_FUNC_digest_init_fn blake2s256_init;
16OSSL_FUNC_digest_init_fn blake2b512_init;
d5e5e2ff
SL
17
18int blake2s256_init(void *ctx)
19{
20 BLAKE2S_PARAM P;
21
22 blake2s_param_init(&P);
23 return blake2s_init((BLAKE2S_CTX *)ctx, &P);
24}
25
26int blake2b512_init(void *ctx)
27{
28 BLAKE2B_PARAM P;
29
30 blake2b_param_init(&P);
31 return blake2b_init((BLAKE2B_CTX *)ctx, &P);
32}
33
c85d5e02
SL
34/* blake2s256_functions */
35IMPLEMENT_digest_functions(blake2s256, BLAKE2S_CTX,
f1d3df3e 36 BLAKE2S_BLOCKBYTES, BLAKE2S_DIGEST_LENGTH, 0,
d5e5e2ff
SL
37 blake2s256_init, blake2s_update, blake2s_final)
38
c85d5e02
SL
39/* blake2b512_functions */
40IMPLEMENT_digest_functions(blake2b512, BLAKE2B_CTX,
f1d3df3e 41 BLAKE2B_BLOCKBYTES, BLAKE2B_DIGEST_LENGTH, 0,
d5e5e2ff 42 blake2b512_init, blake2b_update, blake2b_final)