Home
last modified time | relevance | path

Searched refs:CHK (Results 1 – 6 of 6) sorted by relevance

/mbedtls-latest/programs/cipher/
Dcipher_aead_demo.c94 #define CHK(expr) \ macro
140 CHK(mbedtls_cipher_setup(ctx, in aead_prepare()
145 CHK(mbedtls_cipher_setkey(ctx, key_bytes, key_len, MBEDTLS_ENCRYPT)); in aead_prepare()
188 CHK(mbedtls_cipher_set_iv(ctx, iv, iv_len)); in aead_encrypt()
189 CHK(mbedtls_cipher_reset(ctx)); in aead_encrypt()
190 CHK(mbedtls_cipher_update_ad(ctx, ad, ad_len)); in aead_encrypt()
191 CHK(mbedtls_cipher_update(ctx, part1, part1_len, p, &olen)); in aead_encrypt()
193 CHK(mbedtls_cipher_update(ctx, part2, part2_len, p, &olen)); in aead_encrypt()
195 CHK(mbedtls_cipher_finish(ctx, p, &olen)); in aead_encrypt()
197 CHK(mbedtls_cipher_write_tag(ctx, p, tag_len)); in aead_encrypt()
[all …]
/mbedtls-latest/programs/hash/
Dmd_hmac_demo.c72 #define CHK(expr) \ macro
103 CHK(mbedtls_md_setup(&ctx, info, 1)); in hmac_demo()
104 CHK(mbedtls_md_hmac_starts(&ctx, key_bytes, sizeof(key_bytes))); in hmac_demo()
107 CHK(mbedtls_md_hmac_update(&ctx, msg1_part1, sizeof(msg1_part1))); in hmac_demo()
108 CHK(mbedtls_md_hmac_update(&ctx, msg1_part2, sizeof(msg1_part2))); in hmac_demo()
109 CHK(mbedtls_md_hmac_finish(&ctx, out)); in hmac_demo()
113 CHK(mbedtls_md_hmac_reset(&ctx)); // prepare for new operation in hmac_demo()
114 CHK(mbedtls_md_hmac_update(&ctx, msg2_part1, sizeof(msg2_part1))); in hmac_demo()
115 CHK(mbedtls_md_hmac_update(&ctx, msg2_part2, sizeof(msg2_part2))); in hmac_demo()
116 CHK(mbedtls_md_hmac_finish(&ctx, out)); in hmac_demo()
[all …]
/mbedtls-latest/library/
Dhmac_drbg.c558 #define CHK(c) if ((c) != 0) \ macro
584 CHK(mbedtls_hmac_drbg_seed(&ctx, md_info, in mbedtls_hmac_drbg_self_test()
588 CHK(mbedtls_hmac_drbg_random(&ctx, buf, OUTPUT_LEN)); in mbedtls_hmac_drbg_self_test()
589 CHK(mbedtls_hmac_drbg_random(&ctx, buf, OUTPUT_LEN)); in mbedtls_hmac_drbg_self_test()
590 CHK(memcmp(buf, result_pr, OUTPUT_LEN)); in mbedtls_hmac_drbg_self_test()
609 CHK(mbedtls_hmac_drbg_seed(&ctx, md_info, in mbedtls_hmac_drbg_self_test()
612 CHK(mbedtls_hmac_drbg_reseed(&ctx, NULL, 0)); in mbedtls_hmac_drbg_self_test()
613 CHK(mbedtls_hmac_drbg_random(&ctx, buf, OUTPUT_LEN)); in mbedtls_hmac_drbg_self_test()
614 CHK(mbedtls_hmac_drbg_random(&ctx, buf, OUTPUT_LEN)); in mbedtls_hmac_drbg_self_test()
615 CHK(memcmp(buf, result_nopr, OUTPUT_LEN)); in mbedtls_hmac_drbg_self_test()
Dctr_drbg.c937 #define CHK(c) if ((c) != 0) \ macro
966 CHK(mbedtls_ctr_drbg_seed(&ctx, in mbedtls_ctr_drbg_self_test()
971 CHK(mbedtls_ctr_drbg_random(&ctx, buf, SELF_TEST_OUTPUT_DISCARD_LENGTH)); in mbedtls_ctr_drbg_self_test()
972 CHK(mbedtls_ctr_drbg_random(&ctx, buf, sizeof(result_pr))); in mbedtls_ctr_drbg_self_test()
973 CHK(memcmp(buf, result_pr, sizeof(result_pr))); in mbedtls_ctr_drbg_self_test()
993 CHK(mbedtls_ctr_drbg_seed(&ctx, in mbedtls_ctr_drbg_self_test()
997 CHK(mbedtls_ctr_drbg_reseed(&ctx, NULL, 0)); in mbedtls_ctr_drbg_self_test()
998 CHK(mbedtls_ctr_drbg_random(&ctx, buf, SELF_TEST_OUTPUT_DISCARD_LENGTH)); in mbedtls_ctr_drbg_self_test()
999 CHK(mbedtls_ctr_drbg_random(&ctx, buf, sizeof(result_nopr))); in mbedtls_ctr_drbg_self_test()
1000 CHK(memcmp(buf, result_nopr, sizeof(result_nopr))); in mbedtls_ctr_drbg_self_test()
/mbedtls-latest/tests/src/test_helpers/
Dssl_helpers.c1299 CHK((key0 = mbedtls_calloc(1, keylen + 1)) != NULL); in mbedtls_test_ssl_build_transforms()
1300 CHK((key1 = mbedtls_calloc(1, keylen + 1)) != NULL); in mbedtls_test_ssl_build_transforms()
1307 CHK(cipher_info != NULL); in mbedtls_test_ssl_build_transforms()
1308 CHK(mbedtls_cipher_info_get_iv_size(cipher_info) <= 16); in mbedtls_test_ssl_build_transforms()
1309 CHK(mbedtls_cipher_info_get_key_bitlen(cipher_info) % 8 == 0); in mbedtls_test_ssl_build_transforms()
1312 CHK(mbedtls_cipher_setup(&t_in->cipher_ctx_enc, cipher_info) == 0); in mbedtls_test_ssl_build_transforms()
1313 CHK(mbedtls_cipher_setup(&t_in->cipher_ctx_dec, cipher_info) == 0); in mbedtls_test_ssl_build_transforms()
1314 CHK(mbedtls_cipher_setup(&t_out->cipher_ctx_enc, cipher_info) == 0); in mbedtls_test_ssl_build_transforms()
1315 CHK(mbedtls_cipher_setup(&t_out->cipher_ctx_dec, cipher_info) == 0); in mbedtls_test_ssl_build_transforms()
1319 CHK(mbedtls_cipher_set_padding_mode(&t_in->cipher_ctx_enc, in mbedtls_test_ssl_build_transforms()
[all …]
/mbedtls-latest/tests/include/test/
Dssl_helpers.h487 #define CHK(x) \ macro