MCPcopy Create free account
hub / github.com/F-Stack/f-stack / blake2s_init

Function blake2s_init

freebsd/contrib/libb2/blake2s-ref.c:177–196  ·  view source on GitHub ↗

Sequential blake2s initialization

Source from the content-addressed store, hash-verified

175
176// Sequential blake2s initialization
177int blake2s_init( blake2s_state *S, size_t outlen )
178{
179 blake2s_param P[1];
180
181 /* Move interval verification here? */
182 if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1;
183
184 P->digest_length = ( uint8_t) outlen;
185 P->key_length = 0;
186 P->fanout = 1;
187 P->depth = 1;
188 store32( &P->leaf_length, 0 );
189 store48( &P->node_offset, 0 );
190 P->node_depth = 0;
191 P->inner_length = 0;
192 // memset(P->reserved, 0, sizeof(P->reserved) );
193 memset( P->salt, 0, sizeof( P->salt ) );
194 memset( P->personal, 0, sizeof( P->personal ) );
195 return blake2s_init_param( S, P );
196}
197
198int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen )
199{

Callers 1

blake2sFunction · 0.70

Calls 4

store32Function · 0.85
store48Function · 0.85
memsetFunction · 0.85
blake2s_init_paramFunction · 0.70

Tested by

no test coverage detected