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

Function blake2b_init_param

freebsd/contrib/libb2/blake2b.c:213–227  ·  view source on GitHub ↗

init xors IV with input parameter block */

Source from the content-addressed store, hash-verified

211
212/* init xors IV with input parameter block */
213int blake2b_init_param( blake2b_state *S, const blake2b_param *P )
214{
215 uint8_t *p, *h, *v;
216 //blake2b_init0( S );
217 v = ( uint8_t * )( blake2b_IV );
218 h = ( uint8_t * )( S->h );
219 p = ( uint8_t * )( P );
220 /* IV XOR ParamBlock */
221 memset( S, 0, sizeof( blake2b_state ) );
222
223 for( int i = 0; i < BLAKE2B_OUTBYTES; ++i ) h[i] = v[i] ^ p[i];
224
225 S->outlen = P->digest_length;
226 return 0;
227}
228
229
230/* Some sort of default parameter block initialization, for sequential blake2b */

Callers 4

blake2bp_init_leafFunction · 0.70
blake2bp_init_rootFunction · 0.70
blake2b_initFunction · 0.70
blake2b_init_keyFunction · 0.70

Calls 1

memsetFunction · 0.85

Tested by

no test coverage detected