Lines Matching defs:state
46 static inline void __blake2s_init(struct blake2s_state *state, size_t outlen,
49 state->h[0] = BLAKE2S_IV0 ^ (0x01010000 | keylen << 8 | outlen);
50 state->h[1] = BLAKE2S_IV1;
51 state->h[2] = BLAKE2S_IV2;
52 state->h[3] = BLAKE2S_IV3;
53 state->h[4] = BLAKE2S_IV4;
54 state->h[5] = BLAKE2S_IV5;
55 state->h[6] = BLAKE2S_IV6;
56 state->h[7] = BLAKE2S_IV7;
57 state->t[0] = 0;
58 state->t[1] = 0;
59 state->f[0] = 0;
60 state->f[1] = 0;
61 state->buflen = 0;
62 state->outlen = outlen;
64 memcpy(state->buf, key, keylen);
65 memset(&state->buf[keylen], 0, BLAKE2S_BLOCK_SIZE - keylen);
66 state->buflen = BLAKE2S_BLOCK_SIZE;
70 static inline void blake2s_init(struct blake2s_state *state,
73 __blake2s_init(state, outlen, NULL, 0);
76 static inline void blake2s_init_key(struct blake2s_state *state,
83 __blake2s_init(state, outlen, key, keylen);
86 void blake2s_update(struct blake2s_state *state, const u8 *in, size_t inlen);
87 void blake2s_final(struct blake2s_state *state, u8 *out);
93 struct blake2s_state state;
99 __blake2s_init(&state, outlen, key, keylen);
100 blake2s_update(&state, in, inlen);
101 blake2s_final(&state, out);