Sequential blake2s initialization
| 175 | |
| 176 | // Sequential blake2s initialization |
| 177 | int 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 | |
| 198 | int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ) |
| 199 | { |
no test coverage detected