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

Function blake2bp_init

freebsd/contrib/libb2/blake2bp.c:67–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65
66
67int blake2bp_init( blake2bp_state *S, size_t outlen )
68{
69 if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1;
70
71 memset( S->buf, 0, sizeof( S->buf ) );
72 S->buflen = 0;
73
74 if( blake2bp_init_root( S->R, ( uint8_t ) outlen, 0 ) < 0 )
75 return -1;
76
77 for( size_t i = 0; i < PARALLELISM_DEGREE; ++i )
78 if( blake2bp_init_leaf( S->S[i], ( uint8_t ) outlen, 0, i ) < 0 ) return -1;
79
80 S->R->last_node = 1;
81 S->S[PARALLELISM_DEGREE - 1]->last_node = 1;
82 S->outlen = ( uint8_t ) outlen;
83 return 0;
84}
85
86int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t keylen )
87{

Callers

nothing calls this directly

Calls 3

memsetFunction · 0.85
blake2bp_init_rootFunction · 0.85
blake2bp_init_leafFunction · 0.85

Tested by

no test coverage detected