Lines Matching refs:status
94 psa_status_t status; in supp_psa_cipher_operation() local
104 … status = psa_cipher_update(operation, input + bytes_written, bytes_to_write, output + *output_len, in supp_psa_cipher_operation()
106 ASSERT_STATUS(status, PSA_SUCCESS); in supp_psa_cipher_operation()
112 status = psa_cipher_finish(operation, output + *output_len, output_size - *output_len, &len); in supp_psa_cipher_operation()
113 ASSERT_STATUS(status, PSA_SUCCESS); in supp_psa_cipher_operation()
117 return status; in supp_psa_cipher_operation()
125 psa_status_t status; in aes_128_encrypt_block_psa() local
133 status = psa_import_key(&attributes, key, SUPP_PSA_BLOCK_SIZE_128, &key_id); in aes_128_encrypt_block_psa()
134 ASSERT_STATUS(status, PSA_SUCCESS); in aes_128_encrypt_block_psa()
137 …status = psa_cipher_encrypt(key_id, alg, in, SUPP_PSA_BLOCK_SIZE_128, out, SUPP_PSA_BLOCK_SIZE_128… in aes_128_encrypt_block_psa()
138 ASSERT_STATUS(status, PSA_SUCCESS); in aes_128_encrypt_block_psa()
145 return (int)status; in aes_128_encrypt_block_psa()
150 psa_status_t status; in aes_128_cbc_encrypt_psa() local
166 status = psa_import_key(&attributes, key, SUPP_PSA_BLOCK_SIZE_128, &key_id); in aes_128_cbc_encrypt_psa()
167 ASSERT_STATUS(status, PSA_SUCCESS); in aes_128_cbc_encrypt_psa()
170 status = psa_cipher_encrypt_setup(&operation, key_id, alg); in aes_128_cbc_encrypt_psa()
171 ASSERT_STATUS(status, PSA_SUCCESS); in aes_128_cbc_encrypt_psa()
173 status = psa_cipher_set_iv(&operation, iv, PSA_CIPHER_IV_LENGTH(key_type, alg)); in aes_128_cbc_encrypt_psa()
174 ASSERT_STATUS(status, PSA_SUCCESS); in aes_128_cbc_encrypt_psa()
177 …status = supp_psa_cipher_operation(&operation, data, data_len, PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_t… in aes_128_cbc_encrypt_psa()
179 ASSERT_STATUS(status, PSA_SUCCESS); in aes_128_cbc_encrypt_psa()
188 return (int)status; in aes_128_cbc_encrypt_psa()
193 psa_status_t status; in aes_128_cbc_decrypt_psa() local
209 status = psa_import_key(&attributes, key, SUPP_PSA_BLOCK_SIZE_128, &key_id); in aes_128_cbc_decrypt_psa()
210 ASSERT_STATUS(status, PSA_SUCCESS); in aes_128_cbc_decrypt_psa()
213 status = psa_cipher_decrypt_setup(&operation, key_id, alg); in aes_128_cbc_decrypt_psa()
214 ASSERT_STATUS(status, PSA_SUCCESS); in aes_128_cbc_decrypt_psa()
216 status = psa_cipher_set_iv(&operation, iv, PSA_CIPHER_IV_LENGTH(key_type, alg)); in aes_128_cbc_decrypt_psa()
217 ASSERT_STATUS(status, PSA_SUCCESS); in aes_128_cbc_decrypt_psa()
220 …status = supp_psa_cipher_operation(&operation, data, data_len, PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_t… in aes_128_cbc_decrypt_psa()
222 ASSERT_STATUS(status, PSA_SUCCESS); in aes_128_cbc_decrypt_psa()
231 return (int)status; in aes_128_cbc_decrypt_psa()
236 psa_status_t status; in aes_ctr_encrypt_psa() local
252 status = psa_import_key(&attributes, key, key_len, &key_id); in aes_ctr_encrypt_psa()
253 ASSERT_STATUS(status, PSA_SUCCESS); in aes_ctr_encrypt_psa()
256 status = psa_cipher_encrypt_setup(&operation, key_id, alg); in aes_ctr_encrypt_psa()
257 ASSERT_STATUS(status, PSA_SUCCESS); in aes_ctr_encrypt_psa()
259 status = psa_cipher_set_iv(&operation, nonce, PSA_CIPHER_IV_LENGTH(key_type, alg)); in aes_ctr_encrypt_psa()
260 ASSERT_STATUS(status, PSA_SUCCESS); in aes_ctr_encrypt_psa()
263 …status = supp_psa_cipher_operation(&operation, data, data_len, PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_t… in aes_ctr_encrypt_psa()
265 ASSERT_STATUS(status, PSA_SUCCESS); in aes_ctr_encrypt_psa()
274 return (int)status; in aes_ctr_encrypt_psa()
281 psa_status_t status; in omac1_aes_vector_psa() local
303 status = psa_import_key(&attributes, key, key_len, &key_id); in omac1_aes_vector_psa()
304 ASSERT_STATUS(status, PSA_SUCCESS); in omac1_aes_vector_psa()
307 status = psa_mac_sign_setup(&operation, key_id, alg); in omac1_aes_vector_psa()
308 ASSERT_STATUS(status, PSA_SUCCESS); in omac1_aes_vector_psa()
312 status = psa_mac_update(&operation, addr[i], len[i]); in omac1_aes_vector_psa()
313 ASSERT_STATUS(status, PSA_SUCCESS); in omac1_aes_vector_psa()
316 …status = psa_mac_sign_finish(&operation, mac, PSA_MAC_LENGTH(PSA_KEY_TYPE_AES, key_len * 8, alg), … in omac1_aes_vector_psa()
317 ASSERT_STATUS(status, PSA_SUCCESS); in omac1_aes_vector_psa()
325 return (int)status; in omac1_aes_vector_psa()
331 psa_status_t status; in md_vector_psa() local
345 status = psa_hash_setup(&operation, alg); in md_vector_psa()
346 ASSERT_STATUS(status, PSA_SUCCESS); in md_vector_psa()
350 status = psa_hash_update(&operation, addr[i], len[i]); in md_vector_psa()
351 ASSERT_STATUS(status, PSA_SUCCESS); in md_vector_psa()
354 status = psa_hash_finish(&operation, mac, block_size, &out_len); in md_vector_psa()
355 ASSERT_STATUS(status, PSA_SUCCESS); in md_vector_psa()
359 return (int)status; in md_vector_psa()
370 psa_status_t status; in hmac_vector_psa() local
389 status = psa_import_key(&attributes, key, key_len, &key_id); in hmac_vector_psa()
390 ASSERT_STATUS(status, PSA_SUCCESS); in hmac_vector_psa()
393 status = psa_mac_sign_setup(&operation, key_id, alg); in hmac_vector_psa()
394 ASSERT_STATUS(status, PSA_SUCCESS); in hmac_vector_psa()
398 status = psa_mac_update(&operation, addr[i], len[i]); in hmac_vector_psa()
399 ASSERT_STATUS(status, PSA_SUCCESS); in hmac_vector_psa()
402 …status = psa_mac_sign_finish(&operation, mac, PSA_MAC_LENGTH(PSA_KEY_TYPE_HMAC, key_len * 8, alg),… in hmac_vector_psa()
403 ASSERT_STATUS(status, PSA_SUCCESS); in hmac_vector_psa()
411 return (int)status; in hmac_vector_psa()
419 psa_status_t status; in pbkdf2_sha1_psa() local
437 status = psa_import_key(&attributes, password, plen, &key_id); in pbkdf2_sha1_psa()
438 ASSERT_STATUS(status, PSA_SUCCESS); in pbkdf2_sha1_psa()
440 status = psa_key_derivation_setup(&operation, PSA_ALG_PBKDF2_HMAC(alg)); in pbkdf2_sha1_psa()
441 ASSERT_STATUS(status, PSA_SUCCESS); in pbkdf2_sha1_psa()
443 status = psa_key_derivation_input_integer(&operation, PSA_KEY_DERIVATION_INPUT_COST, in pbkdf2_sha1_psa()
445 ASSERT_STATUS(status, PSA_SUCCESS); in pbkdf2_sha1_psa()
447 status = psa_key_derivation_input_bytes(&operation, PSA_KEY_DERIVATION_INPUT_SALT, salt, in pbkdf2_sha1_psa()
449 ASSERT_STATUS(status, PSA_SUCCESS); in pbkdf2_sha1_psa()
451 status = psa_key_derivation_input_key(&operation, PSA_KEY_DERIVATION_INPUT_PASSWORD, in pbkdf2_sha1_psa()
453 ASSERT_STATUS(status, PSA_SUCCESS); in pbkdf2_sha1_psa()
455 status = psa_key_derivation_output_bytes(&operation, output, key_length); in pbkdf2_sha1_psa()
456 ASSERT_STATUS(status, PSA_SUCCESS); in pbkdf2_sha1_psa()
461 return (int)status; in pbkdf2_sha1_psa()