]>
Commit | Line | Data |
---|---|---|
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> | |
11 | #include "internal/blake2.h" | |
12 | #include "internal/core_mkdigest.h" | |
13 | #include "internal/provider_algs.h" | |
14 | ||
15 | OSSL_OP_digest_init_fn blake2s256_init; | |
16 | OSSL_OP_digest_init_fn blake2b512_init; | |
17 | ||
18 | int 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 | ||
26 | int 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 | ||
34 | OSSL_FUNC_DIGEST_CONSTRUCT(blake2s256, BLAKE2S_CTX, | |
35 | BLAKE2S_BLOCKBYTES, BLAKE2S_DIGEST_LENGTH, | |
36 | blake2s256_init, blake2s_update, blake2s_final) | |
37 | ||
38 | OSSL_FUNC_DIGEST_CONSTRUCT(blake2b512, BLAKE2B_CTX, | |
39 | BLAKE2B_BLOCKBYTES, BLAKE2B_DIGEST_LENGTH, | |
40 | blake2b512_init, blake2b_update, blake2b_final) |