blake2.h
Go to the documentation of this file.
1 /* Copyright (c) 2021, Google Inc.
2  *
3  * Permission to use, copy, modify, and/or distribute this software for any
4  * purpose with or without fee is hereby granted, provided that the above
5  * copyright notice and this permission notice appear in all copies.
6  *
7  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
10  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
12  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
13  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
14 
15 #ifndef OPENSSL_HEADER_BLAKE2_H
16 #define OPENSSL_HEADER_BLAKE2_H
17 
18 #include <openssl/base.h>
19 
20 #if defined(__cplusplus)
21 extern "C" {
22 #endif
23 
24 
25 #define BLAKE2B256_DIGEST_LENGTH (256 / 8)
26 #define BLAKE2B_CBLOCK 128
27 
29  uint64_t h[8];
31  union {
34  } block;
35  size_t block_used;
36 };
37 
38 // BLAKE2B256_Init initialises |b2b| to perform a BLAKE2b-256 hash. There are no
39 // pointers inside |b2b| thus release of |b2b| is purely managed by the caller.
41 
42 // BLAKE2B256_Update appends |len| bytes from |data| to the digest being
43 // calculated by |b2b|.
44 OPENSSL_EXPORT void BLAKE2B256_Update(BLAKE2B_CTX *b2b, const void *data,
45  size_t len);
46 
47 // BLAKE2B256_Final completes the digest calculated by |b2b| and writes
48 // |BLAKE2B256_DIGEST_LENGTH| bytes to |out|.
50  BLAKE2B_CTX *b2b);
51 
52 // BLAKE2B256 writes the BLAKE2b-256 digset of |len| bytes from |data| to
53 // |out|.
54 OPENSSL_EXPORT void BLAKE2B256(const uint8_t *data, size_t len,
56 
57 
58 #if defined(__cplusplus)
59 } // extern C
60 #endif
61 
62 #endif // OPENSSL_HEADER_BLAKE2_H
gen_build_yaml.out
dictionary out
Definition: src/benchmark/gen_build_yaml.py:24
blake2b_state_st::t_high
uint64_t t_high
Definition: blake2.h:30
BLAKE2B256_Update
OPENSSL_EXPORT void BLAKE2B256_Update(BLAKE2B_CTX *b2b, const void *data, size_t len)
Definition: blake2.c:107
blake2b_state_st::bytes
uint8_t bytes[BLAKE2B_CBLOCK]
Definition: blake2.h:32
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
base.h
blake2b_state_st::words
uint64_t words[16]
Definition: blake2.h:33
blake2b_state_st
Definition: blake2.h:28
blake2b_state_st::h
uint64_t h[8]
Definition: blake2.h:29
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
blake2b_state_st::block
union blake2b_state_st::@362 block
BLAKE2B256_DIGEST_LENGTH
#define BLAKE2B256_DIGEST_LENGTH
Definition: blake2.h:25
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
BLAKE2B256
OPENSSL_EXPORT void BLAKE2B256(const uint8_t *data, size_t len, uint8_t out[BLAKE2B256_DIGEST_LENGTH])
Definition: blake2.c:150
blake2b_state_st::t_low
uint64_t t_low
Definition: blake2.h:30
BLAKE2B_CBLOCK
#define BLAKE2B_CBLOCK
Definition: blake2.h:26
BLAKE2B256_Final
OPENSSL_EXPORT void BLAKE2B256_Final(uint8_t out[BLAKE2B256_DIGEST_LENGTH], BLAKE2B_CTX *b2b)
Definition: blake2.c:141
OPENSSL_EXPORT
#define OPENSSL_EXPORT
Definition: base.h:222
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
BLAKE2B256_Init
OPENSSL_EXPORT void BLAKE2B256_Init(BLAKE2B_CTX *b2b)
Definition: blake2.c:97
blake2b_state_st::block_used
size_t block_used
Definition: blake2.h:35


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:39