Lines Matching refs:status
34 err_status_t status;
52 status = hmac_init(&hmac_ctx, key, KEY_LEN);
53 if (status) return status;
54 status = hmac_compute(&hmac_ctx, "ENC", 3, ENC_KEY_LEN, enc_key);
55 if (status) return status;
57 status = hmac_init(&hmac_ctx, key, KEY_LEN);
58 if (status) return status;
59 status = hmac_compute(&hmac_ctx, "MAC", 3, MAC_KEY_LEN, mac_key);
60 if (status) return status;
66 status = aes_cbc_context_init(&aes_ctx, key, direction_encrypt);
67 if (status) return status;
70 status = crypto_get_random(iv, IV_LEN);
71 if (status) return status;
72 status = aes_cbc_set_iv(&aes_ctx, iv);
75 status = aes_cbc_nist_encrypt(&aes_ctx, opaque, opaque_len);
76 if (status) return status;
79 status = hmac_init(&hmac_ctx, mac_key, MAC_KEY_LEN);
80 if (status) return status;
82 status = hmac_start(&hmac_ctx);
83 if (status) return status;
85 status = hmac_update(&hmac_ctx, clear, clear_len);
86 if (status) return status;
88 status = hmac_compute(&hmac_ctx, opaque, *opaque_len, TAG_LEN, auth_tag);
89 if (status) return status;
110 err_status_t status;
129 status = hmac_init(&hmac_ctx, key, KEY_LEN);
130 if (status) return status;
131 status = hmac_compute(&hmac_ctx, "ENC", 3, ENC_KEY_LEN, enc_key);
132 if (status) return status;
134 status = hmac_init(&hmac_ctx, key, KEY_LEN);
135 if (status) return status;
136 status = hmac_compute(&hmac_ctx, "MAC", 3, MAC_KEY_LEN, mac_key);
137 if (status) return status;
142 status = aes_cbc_context_init(&aes_ctx, key, direction_decrypt);
143 if (status) return status;
146 status = rand_source_get_octet_string(iv, IV_LEN);
147 if (status) return status;
148 status = aes_cbc_set_iv(&aes_ctx, iv);
151 status = aes_cbc_nist_decrypt(&aes_ctx, opaque, opaque_len);
152 if (status) return status;
155 status = hmac_init(&hmac_ctx, mac_key, MAC_KEY_LEN);
156 if (status) return status;
158 status = hmac_start(&hmac_ctx);
159 if (status) return status;
161 status = hmac_update(&hmac_ctx, clear, clear_len);
162 if (status) return status;
164 status = hmac_compute(&hmac_ctx, opaque, *opaque_len, TAG_LEN, tmp_tag);
165 if (status) return status;
195 err_status_t status;
217 status = hmac_init(&hmac_ctx, key, KEY_LEN);
218 if (status) return status;
219 status = hmac_compute(&hmac_ctx, "ENC", 3, ENC_KEY_LEN, enc_key);
220 if (status) return status;
222 status = hmac_init(&hmac_ctx, key, KEY_LEN);
223 if (status) return status;
224 status = hmac_compute(&hmac_ctx, "MAC", 3, MAC_KEY_LEN, mac_key);
225 if (status) return status;
231 status = aes_cbc_context_init(&aes_ctx, key, direction_encrypt);
232 if (status) return status;
235 status = rand_source_get_octet_string(iv, IV_LEN);
236 if (status) return status;
237 status = aes_cbc_set_iv(&aes_ctx, iv);
238 if (status) return status;
248 status = aes_cbc_nist_encrypt(&aes_ctx, opaque, opaque_len);
249 if (status) return status;
262 status = hmac_init(&hmac_ctx, mac_key, MAC_KEY_LEN);
263 if (status) return status;
265 status = hmac_start(&hmac_ctx);
266 if (status) return status;
268 status = hmac_update(&hmac_ctx, clear, clear_len);
269 if (status) return status;
276 status = hmac_compute(&hmac_ctx, opaque, *opaque_len, TAG_LEN, auth_tag);
277 if (status) return status;
308 err_status_t status;
330 status = hmac_init(&hmac_ctx, key, KEY_LEN);
331 if (status) return status;
332 status = hmac_compute(&hmac_ctx, "ENC", 3, ENC_KEY_LEN, enc_key);
333 if (status) return status;
335 status = hmac_init(&hmac_ctx, key, KEY_LEN);
336 if (status) return status;
337 status = hmac_compute(&hmac_ctx, "MAC", 3, MAC_KEY_LEN, mac_key);
338 if (status) return status;
360 status = hmac_init(&hmac_ctx, mac_key, MAC_KEY_LEN);
361 if (status) return status;
363 status = hmac_start(&hmac_ctx);
364 if (status) return status;
366 status = hmac_update(&hmac_ctx, clear, clear_len);
367 if (status) return status;
374 status = hmac_compute(&hmac_ctx, opaque, ciphertext_len, TAG_LEN, tmp_tag);
375 if (status) return status;
401 status = aes_cbc_context_init(&aes_ctx, key, direction_decrypt);
402 if (status) return status;
403 status = aes_cbc_set_iv(&aes_ctx, iv);
404 if (status) return status;
412 status = aes_cbc_nist_decrypt(&aes_ctx, opaque, &ciphertext_len);
413 if (status) return status;