• Home
  • Raw
  • Download

Lines Matching refs:state

75 static void process_nh_hash_value(struct nhpoly1305_state *state,  in process_nh_hash_value()  argument
80 poly1305_core_blocks(&state->poly_state, &key->poly_key, state->nh_hash, in process_nh_hash_value()
91 static void nhpoly1305_units(struct nhpoly1305_state *state, in nhpoly1305_units() argument
98 if (state->nh_remaining == 0) { in nhpoly1305_units()
101 nh_fn(key->nh_key, src, bytes, state->nh_hash); in nhpoly1305_units()
102 state->nh_remaining = NH_MESSAGE_BYTES - bytes; in nhpoly1305_units()
109 pos = NH_MESSAGE_BYTES - state->nh_remaining; in nhpoly1305_units()
110 bytes = min(srclen, state->nh_remaining); in nhpoly1305_units()
113 le64_add_cpu(&state->nh_hash[i], in nhpoly1305_units()
115 state->nh_remaining -= bytes; in nhpoly1305_units()
117 if (state->nh_remaining == 0) in nhpoly1305_units()
118 process_nh_hash_value(state, key); in nhpoly1305_units()
145 struct nhpoly1305_state *state = shash_desc_ctx(desc); in crypto_nhpoly1305_init() local
147 poly1305_core_init(&state->poly_state); in crypto_nhpoly1305_init()
148 state->buflen = 0; in crypto_nhpoly1305_init()
149 state->nh_remaining = 0; in crypto_nhpoly1305_init()
158 struct nhpoly1305_state *state = shash_desc_ctx(desc); in crypto_nhpoly1305_update_helper() local
162 if (state->buflen) { in crypto_nhpoly1305_update_helper()
163 bytes = min(srclen, (int)NH_MESSAGE_UNIT - state->buflen); in crypto_nhpoly1305_update_helper()
164 memcpy(&state->buffer[state->buflen], src, bytes); in crypto_nhpoly1305_update_helper()
165 state->buflen += bytes; in crypto_nhpoly1305_update_helper()
166 if (state->buflen < NH_MESSAGE_UNIT) in crypto_nhpoly1305_update_helper()
168 nhpoly1305_units(state, key, state->buffer, NH_MESSAGE_UNIT, in crypto_nhpoly1305_update_helper()
170 state->buflen = 0; in crypto_nhpoly1305_update_helper()
177 nhpoly1305_units(state, key, src, bytes, nh_fn); in crypto_nhpoly1305_update_helper()
183 memcpy(state->buffer, src, srclen); in crypto_nhpoly1305_update_helper()
184 state->buflen = srclen; in crypto_nhpoly1305_update_helper()
199 struct nhpoly1305_state *state = shash_desc_ctx(desc); in crypto_nhpoly1305_final_helper() local
202 if (state->buflen) { in crypto_nhpoly1305_final_helper()
203 memset(&state->buffer[state->buflen], 0, in crypto_nhpoly1305_final_helper()
204 NH_MESSAGE_UNIT - state->buflen); in crypto_nhpoly1305_final_helper()
205 nhpoly1305_units(state, key, state->buffer, NH_MESSAGE_UNIT, in crypto_nhpoly1305_final_helper()
209 if (state->nh_remaining) in crypto_nhpoly1305_final_helper()
210 process_nh_hash_value(state, key); in crypto_nhpoly1305_final_helper()
212 poly1305_core_emit(&state->poly_state, dst); in crypto_nhpoly1305_final_helper()