/mbedtls-latest/3rdparty/everest/include/everest/kremlin/ |
D | c_endianness.h | 21 # define htole64(x) OSSwapHostToLittleInt64(x) argument 22 # define le64toh(x) OSSwapLittleToHostInt64(x) argument 23 # define htobe64(x) OSSwapHostToBigInt64(x) argument 24 # define be64toh(x) OSSwapBigToHostInt64(x) argument 26 # define htole16(x) OSSwapHostToLittleInt16(x) argument 27 # define le16toh(x) OSSwapLittleToHostInt16(x) argument 28 # define htobe16(x) OSSwapHostToBigInt16(x) argument 29 # define be16toh(x) OSSwapBigToHostInt16(x) argument 31 # define htole32(x) OSSwapHostToLittleInt32(x) argument 32 # define le32toh(x) OSSwapLittleToHostInt32(x) argument [all …]
|
/mbedtls-latest/library/ |
D | alignment.h | 87 uint16_t x; member 90 uint32_t x; member 93 uint64_t x; member 123 r = p16->x; in mbedtls_get_unaligned_uint16() 142 static inline void mbedtls_put_unaligned_uint16(void *p, uint16_t x) in mbedtls_put_unaligned_uint16() argument 146 *p16 = x; in mbedtls_put_unaligned_uint16() 149 p16->x = x; in mbedtls_put_unaligned_uint16() 151 memcpy(p, &x, sizeof(x)); in mbedtls_put_unaligned_uint16() 175 r = p32->x; in mbedtls_get_unaligned_uint32() 194 static inline void mbedtls_put_unaligned_uint32(void *p, uint32_t x) in mbedtls_put_unaligned_uint32() argument [all …]
|
D | constant_time_impl.h | 100 static inline mbedtls_ct_uint_t mbedtls_ct_compiler_opaque(mbedtls_ct_uint_t x) in mbedtls_ct_compiler_opaque() argument 103 asm volatile ("" : [x] "+r" (x) :); in mbedtls_ct_compiler_opaque() 104 return x; in mbedtls_ct_compiler_opaque() 106 return x ^ mbedtls_ct_zero; in mbedtls_ct_compiler_opaque() 135 static inline mbedtls_ct_condition_t mbedtls_ct_bool(mbedtls_ct_uint_t x) in mbedtls_ct_bool() argument 152 [x] "+&r" (x) in mbedtls_ct_bool() 156 return (mbedtls_ct_condition_t) x; in mbedtls_ct_bool() 166 [x] "+&l" (x) in mbedtls_ct_bool() 171 return (mbedtls_ct_condition_t) x; in mbedtls_ct_bool() 181 [x] "D" (x) in mbedtls_ct_bool() [all …]
|
D | common.h | 199 uint8x16_t x = veorq_u8(v1, v2); in mbedtls_xor() local 200 vst1q_u8(r + i, x); in mbedtls_xor() 214 uint64_t x = mbedtls_get_unaligned_uint64(a + i) ^ mbedtls_get_unaligned_uint64(b + i); in mbedtls_xor() local 215 mbedtls_put_unaligned_uint64(r + i, x); in mbedtls_xor() 224 uint32_t x = mbedtls_get_unaligned_uint32(a + i) ^ mbedtls_get_unaligned_uint32(b + i); in mbedtls_xor() local 225 mbedtls_put_unaligned_uint32(r + i, x); in mbedtls_xor() 278 uint64_t x = mbedtls_get_unaligned_uint64(a + i) ^ mbedtls_get_unaligned_uint64(b + i); in mbedtls_xor_no_simd() local 279 mbedtls_put_unaligned_uint64(r + i, x); in mbedtls_xor_no_simd() 292 uint32_t x = mbedtls_get_unaligned_uint32(a + i) ^ mbedtls_get_unaligned_uint32(b + i); in mbedtls_xor_no_simd() local 293 mbedtls_put_unaligned_uint32(r + i, x); in mbedtls_xor_no_simd() [all …]
|
D | sha512.c | 38 #define UL64(x) x##ui64 argument 40 #define UL64(x) x##ULL argument 359 static inline uint64x2_t vsha512su0q_u64(uint64x2_t x, uint64x2_t y) in vsha512su0q_u64() argument 361 asm ("sha512su0 %0.2D,%1.2D" : "+w" (x) : "w" (y)); in vsha512su0q_u64() 362 return x; in vsha512su0q_u64() 364 static inline uint64x2_t vsha512su1q_u64(uint64x2_t x, uint64x2_t y, uint64x2_t z) in vsha512su1q_u64() argument 366 asm ("sha512su1 %0.2D,%1.2D,%2.2D" : "+w" (x) : "w" (y), "w" (z)); in vsha512su1q_u64() 367 return x; in vsha512su1q_u64() 369 static inline uint64x2_t vsha512hq_u64(uint64x2_t x, uint64x2_t y, uint64x2_t z) in vsha512hq_u64() argument 371 asm ("sha512h %0,%1,%2.2D" : "+w" (x) : "w" (y), "w" (z)); in vsha512hq_u64() [all …]
|
/mbedtls-latest/3rdparty/p256-m/p256-m/ |
D | p256-m.c | 69 static void u256_set32(uint32_t z[8], uint32_t x) in u256_set32() argument 71 z[0] = x; in u256_set32() 88 const uint32_t x[8], const uint32_t y[8]) in u256_add() 93 uint64_t sum = (uint64_t) carry + x[i] + y[i]; in u256_add() 112 const uint32_t x[8], const uint32_t y[8]) in u256_sub() 117 uint64_t diff = (uint64_t) x[i] - y[i] - carry; in u256_sub() 134 static void u256_cmov(uint32_t z[8], const uint32_t x[8], uint32_t c) in u256_cmov() 138 z[i] = (z[i] & ~x_mask) | (x[i] & x_mask); in u256_cmov() 149 static uint32_t u256_diff(const uint32_t x[8], const uint32_t y[8]) in u256_diff() 153 diff |= x[i] ^ y[i]; in u256_diff() [all …]
|
/mbedtls-latest/3rdparty/everest/library/kremlib/ |
D | FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.c | 15 uint64_t x = a ^ b; in FStar_UInt64_eq_mask() local 16 uint64_t minus_x = ~x + (uint64_t)1U; in FStar_UInt64_eq_mask() 17 uint64_t x_or_minus_x = x | minus_x; in FStar_UInt64_eq_mask() 24 uint64_t x = a; in FStar_UInt64_gte_mask() local 26 uint64_t x_xor_y = x ^ y; in FStar_UInt64_gte_mask() 27 uint64_t x_sub_y = x - y; in FStar_UInt64_gte_mask() 30 uint64_t x_xor_q = x ^ q; in FStar_UInt64_gte_mask() 37 uint32_t x = a ^ b; in FStar_UInt32_eq_mask() local 38 uint32_t minus_x = ~x + (uint32_t)1U; in FStar_UInt32_eq_mask() 39 uint32_t x_or_minus_x = x | minus_x; in FStar_UInt32_eq_mask() [all …]
|
/mbedtls-latest/tests/suites/ |
D | test_suite_bignum_mod.function | 240 mbedtls_mpi_mod_residue x = { NULL, 0 }; 264 x.p = X_raw; 265 x.limbs = limbs + 1; 267 mbedtls_mpi_mod_sub(&x, &a, &b, &m)); 276 x.p = X_raw; 277 x.limbs = limbs - 1; 279 mbedtls_mpi_mod_sub(&x, &a, &b, &m)); 291 TEST_EQUAL(0, mbedtls_mpi_mod_residue_setup(&x, &m, X_raw, limbs)); 294 TEST_EQUAL(expected_ret, mbedtls_mpi_mod_sub(&x, &a, &b, &m)); 299 TEST_COMPARE_MPI_RESIDUES(x, d); [all …]
|
D | test_suite_lmots.function | 42 key_id->x, leaf_id, seed->x, seed->len), 0); 45 msg->x, msg->len, sig, sizeof(sig), NULL), 0); 46 TEST_EQUAL(mbedtls_lmots_verify(&pub_ctx, msg->x, msg->len, sig, sizeof(sig)), 0); 65 key_id->x, leaf_id, seed->x, seed->len), 0); 87 TEST_EQUAL(mbedtls_lmots_import_public_key(&ctx, pub_key->x, pub_key->len), 0); 89 TEST_EQUAL(mbedtls_lmots_verify(&ctx, msg->x, msg->len, sig->x, sig->len), expected_rc); 95 msg->x[0] ^= 1; 96 TEST_EQUAL(mbedtls_lmots_verify(&ctx, msg->x, msg->len, sig->x, sig->len), 98 msg->x[0] ^= 1; 101 msg->x[msg->len - 1] ^= 1; [all …]
|
D | test_suite_ccm.function | 27 TEST_EQUAL(0, mbedtls_ccm_starts(ctx, mode, iv->x, iv->len)); 29 TEST_EQUAL(0, mbedtls_ccm_update_ad(ctx, add->x, n1_add)); 30 TEST_EQUAL(0, mbedtls_ccm_update_ad(ctx, add->x + n1_add, n2_add)); 37 TEST_EQUAL(0, mbedtls_ccm_update(ctx, input->x, n1, output, n1, &olen)); 39 TEST_MEMORY_COMPARE(output, olen, expected_output->x, n1); 45 TEST_EQUAL(0, mbedtls_ccm_update(ctx, input->x + n1, n2, output, n2, &olen)); 47 TEST_MEMORY_COMPARE(output, olen, expected_output->x + n1, n2); 53 TEST_MEMORY_COMPARE(output, tag->len, tag->x, tag->len); 198 const uint8_t *expected_tag = result->x + msg->len; 203 memcpy(io_msg_buf, msg->x, msg->len); [all …]
|
D | test_suite_des.function | 13 TEST_ASSERT(mbedtls_des_key_check_weak(key->x) == ret); 27 TEST_ASSERT(mbedtls_des_setkey_enc(&ctx, key_str->x) == 0); 28 TEST_ASSERT(mbedtls_des_crypt_ecb(&ctx, src_str->x, output) == 0); 30 TEST_ASSERT(mbedtls_test_hexcmp(output, dst->x, 8, dst->len) == 0); 47 TEST_ASSERT(mbedtls_des_setkey_dec(&ctx, key_str->x) == 0); 48 TEST_ASSERT(mbedtls_des_crypt_ecb(&ctx, src_str->x, output) == 0); 50 TEST_ASSERT(mbedtls_test_hexcmp(output, dst->x, 8, dst->len) == 0); 68 TEST_ASSERT(mbedtls_des_setkey_enc(&ctx, key_str->x) == 0); 69 TEST_ASSERT(mbedtls_des_crypt_cbc(&ctx, MBEDTLS_DES_ENCRYPT, src_str->len, iv_str->x, 70 src_str->x, output) == cbc_result); [all …]
|
D | test_suite_bignum_core.misc.data | 161 mbedtls_mpi_core_lt_ct: x=y (1 limb) 164 mbedtls_mpi_core_lt_ct: x>y (1 limb) 167 mbedtls_mpi_core_lt_ct: x<y (1 limb) 170 mbedtls_mpi_core_lt_ct: x>y (63 bit x, y first byte greater) 173 mbedtls_mpi_core_lt_ct: x<y (63 bit y, x first byte greater) 176 mbedtls_mpi_core_lt_ct: x>y (64 bit x, y=x-1) 179 mbedtls_mpi_core_lt_ct: x<y (64 bit y, x=y-1) 182 mbedtls_mpi_core_lt_ct: x>y (64 bit x, y=1) 185 mbedtls_mpi_core_lt_ct: x<y (64 bit y, x=1) 188 mbedtls_mpi_core_lt_ct: x>y (64 bit x, y=0) [all …]
|
D | test_suite_pkcs1_v21.function | 24 info.buf = rnd_buf->x; 36 TEST_ASSERT(mbedtls_mpi_read_binary(&N, input_N->x, input_N->len) == 0); 37 TEST_ASSERT(mbedtls_mpi_read_binary(&E, input_E->x, input_E->len) == 0); 43 message_str->x = NULL; 48 message_str->x, 51 TEST_MEMORY_COMPARE(output, ctx.len, result_str->x, result_str->len); 89 TEST_ASSERT(mbedtls_mpi_read_binary(&P, input_P->x, input_P->len) == 0); 90 TEST_ASSERT(mbedtls_mpi_read_binary(&Q, input_Q->x, input_Q->len) == 0); 91 TEST_ASSERT(mbedtls_mpi_read_binary(&N, input_N->x, input_N->len) == 0); 92 TEST_ASSERT(mbedtls_mpi_read_binary(&E, input_E->x, input_E->len) == 0); [all …]
|
D | test_suite_lms.function | 27 seed->x, seed->len), 0); 32 msg->x, msg->len, sig, sizeof(sig), 35 TEST_EQUAL(mbedtls_lms_verify(&pub_ctx, msg->x, msg->len, sig, 60 seed->x, seed->len), 0); 87 TEST_EQUAL(mbedtls_lms_import_public_key(&ctx, pub_key->x, pub_key->len), 0); 89 TEST_EQUAL(mbedtls_lms_verify(&ctx, msg->x, msg->len, sig->x, sig->len), expected_rc); 95 msg->x[0] ^= 1; 96 TEST_EQUAL(mbedtls_lms_verify(&ctx, msg->x, msg->len, sig->x, sig->len), 98 msg->x[0] ^= 1; 101 msg->x[msg->len - 1] ^= 1; [all …]
|
D | test_suite_aria.function | 74 TEST_ASSERT(mbedtls_aria_setkey_enc(&ctx, key_str->x, key_str->len * 8) 78 TEST_ASSERT(mbedtls_aria_crypt_ecb(&ctx, src_str->x + i, 83 expected_output->x, expected_output->len); 102 TEST_ASSERT(mbedtls_aria_setkey_dec(&ctx, key_str->x, key_str->len * 8) 106 TEST_ASSERT(mbedtls_aria_crypt_ecb(&ctx, src_str->x + i, 111 expected_output->x, expected_output->len); 130 mbedtls_aria_setkey_enc(&ctx, key_str->x, key_str->len * 8); 132 src_str->len, iv_str->x, src_str->x, 136 expected_output->x, expected_output->len); 155 mbedtls_aria_setkey_dec(&ctx, key_str->x, key_str->len * 8); [all …]
|
D | test_suite_alignment.function | 37 uint8_t *x = (uint8_t *) raw; 39 x[i] = (uint8_t) i; 47 r = mbedtls_get_unaligned_uint16(x + offset); 50 r = mbedtls_get_unaligned_uint32(x + offset); 53 r = mbedtls_get_unaligned_uint64(x + offset); 81 x[i + offset] = 0xff; 89 mbedtls_put_unaligned_uint16(x + offset, r); 92 mbedtls_put_unaligned_uint32(x + offset, r); 95 mbedtls_put_unaligned_uint64(x + offset, r); 98 for (size_t i = 0; i < sizeof(x); i++) { [all …]
|
D | test_suite_camellia.function | 57 TEST_ASSERT(mbedtls_camellia_setkey_enc(&ctx, key_str->x, key_str->len * 8) == setkey_result); 59 TEST_ASSERT(mbedtls_camellia_crypt_ecb(&ctx, MBEDTLS_CAMELLIA_ENCRYPT, src_str->x, 62 TEST_ASSERT(mbedtls_test_hexcmp(output, dst->x, 16, dst->len) == 0); 81 TEST_ASSERT(mbedtls_camellia_setkey_dec(&ctx, key_str->x, key_str->len * 8) == setkey_result); 83 TEST_ASSERT(mbedtls_camellia_crypt_ecb(&ctx, MBEDTLS_CAMELLIA_DECRYPT, src_str->x, 86 TEST_ASSERT(mbedtls_test_hexcmp(output, dst->x, 16, dst->len) == 0); 105 mbedtls_camellia_setkey_enc(&ctx, key_str->x, key_str->len * 8); 106 TEST_ASSERT(mbedtls_camellia_crypt_cbc(&ctx, MBEDTLS_CAMELLIA_ENCRYPT, src_str->len, iv_str->x, 107 src_str->x, output) == cbc_result); 110 TEST_ASSERT(mbedtls_test_hexcmp(output, dst->x, src_str->len, [all …]
|
D | test_suite_ecdsa.function | 101 rnd_info.buf = rnd_buf->x; 104 /* Fix rnd_buf->x by shifting it left if necessary */ 110 rnd_buf->x[i] = rnd_buf->x[i] << shift | rnd_buf->x[i+1] >> (8 - shift); 113 rnd_buf->x[rnd_info.length-1] <<= shift; 116 TEST_ASSERT(mbedtls_ecdsa_sign(&grp, &r, &s, &d, hash->x, hash->len, 125 TEST_EQUAL(mbedtls_ecdsa_verify(&grp, hash->x, hash->len, 129 TEST_EQUAL(mbedtls_ecdsa_verify(&grp, hash->x, hash->len, 136 TEST_EQUAL(mbedtls_ecdsa_verify(&grp, hash->x, hash->len, &Q, 138 TEST_EQUAL(mbedtls_ecdsa_verify(&grp, hash->x, hash->len, &Q, 140 TEST_EQUAL(mbedtls_ecdsa_verify(&grp, hash->x, hash->len, &Q, [all …]
|
D | test_suite_poly1305.function | 22 TEST_ASSERT(mbedtls_poly1305_mac(key->x, src_str->x, 26 expected_mac->x, expected_mac->len); 33 TEST_ASSERT(mbedtls_poly1305_starts(&ctx, key->x) == 0); 35 TEST_ASSERT(mbedtls_poly1305_update(&ctx, src_str->x, src_str->len) == 0); 40 expected_mac->x, expected_mac->len); 49 TEST_ASSERT(mbedtls_poly1305_starts(&ctx, key->x) == 0); 51 TEST_ASSERT(mbedtls_poly1305_update(&ctx, src_str->x, 1) == 0); 52 TEST_ASSERT(mbedtls_poly1305_update(&ctx, src_str->x + 1, src_str->len - 1) == 0); 57 expected_mac->x, expected_mac->len); 64 TEST_ASSERT(mbedtls_poly1305_starts(&ctx, key->x) == 0); [all …]
|
D | test_suite_pkcs5.function | 18 TEST_ASSERT(mbedtls_pkcs5_pbkdf2_hmac_ext(hash, pw_str->x, pw_str->len, 19 salt_str->x, salt_str->len, 22 TEST_ASSERT(mbedtls_test_hexcmp(key, result_key_string->x, 44 params.p = params_hex->x; 52 pw->x, pw->len, data->x, data->len, my_out); 57 ref_out->x, ref_out->len); 63 pw->x, pw->len, data->x, data->len, my_out, 68 ref_out->x, ref_out->len); 93 params.p = params_hex->x; 101 pw->x, pw->len, data->x, data->len, my_out); [all …]
|
D | test_suite_pkcs12.function | 36 password = password_arg->x; 42 salt = salt_arg->x; 62 TEST_MEMORY_COMPARE(expected_output->x, expected_output->len, 91 pbe_params.p = params_hex->x; 96 md_alg, pw->x, pw->len, data->x, data->len, my_out); 101 ref_out->x, ref_out->len); 109 pbe_params.p = params_hex->x; 112 md_alg, pw->x, pw->len, data->x, data->len, my_out, 117 ref_out->x, ref_out->len); 146 pbe_params.p = params_hex->x; [all …]
|
D | test_suite_gcm.function | 29 iv->x, iv->len)); 30 TEST_EQUAL(0, mbedtls_gcm_update_ad(ctx, add->x, n1_add)); 31 TEST_EQUAL(0, mbedtls_gcm_update_ad(ctx, add->x + n1_add, n2_add)); 38 TEST_EQUAL(0, mbedtls_gcm_update(ctx, input->x, n1, output, n1, &olen)); 40 TEST_MEMORY_COMPARE(output, olen, expected_output->x, n1); 46 TEST_EQUAL(0, mbedtls_gcm_update(ctx, input->x + n1, n2, output, n2, &olen)); 48 TEST_MEMORY_COMPARE(output, olen, expected_output->x + n1, n2); 55 TEST_MEMORY_COMPARE(output, tag->len, tag->x, tag->len); 81 iv->x, iv->len)); 92 TEST_EQUAL(0, mbedtls_gcm_update(ctx, input->x, input->len, output, input->len, &olen)); [all …]
|
D | test_suite_aes.function | 24 TEST_ASSERT(mbedtls_aes_setkey_enc(master, key->x, 32 TEST_ASSERT(mbedtls_aes_setkey_dec(master, key->x, 79 TEST_ASSERT(mbedtls_aes_setkey_enc(&ctx, key_str->x, key_str->len * 8) == setkey_result); 81 TEST_ASSERT(mbedtls_aes_crypt_ecb(&ctx, MBEDTLS_AES_ENCRYPT, src_str->x, output) == 0); 83 TEST_ASSERT(mbedtls_test_hexcmp(output, dst->x, 16, dst->len) == 0); 109 TEST_ASSERT(mbedtls_aes_setkey_enc(&ctx, key->x, key->len * 8) == 0); 111 memcpy(ctr, ictr->x, 16); 120 stream_block, pt->x, output), 0); 121 TEST_ASSERT(!!memcmp(output, ct->x, len) == expected); 125 stream_block, ct->x, output), 0); [all …]
|
D | test_suite_asn1parse.function | 144 memcpy(buf, input->x, input->len); 147 memcpy(buf, input->x, buffer_size); 251 memcpy(buf, input->x, buffer_size); 310 unsigned char *p = input->x; 313 ret = mbedtls_asn1_get_bool(&p, input->x + input->len, &val); 317 TEST_ASSERT(p == input->x + input->len); 336 p = input->x; 337 TEST_EQUAL(mbedtls_asn1_get_int(&p, input->x + input->len, &val), 343 p = input->x; 344 TEST_EQUAL(mbedtls_asn1_get_mpi(&p, input->x + input->len, &actual_mpi), [all …]
|
D | test_suite_chacha20.function | 29 TEST_ASSERT(mbedtls_chacha20_crypt(key_str->x, nonce_str->x, counter, src_str->len, src_str->x, 33 expected_output_str->x, expected_output_str->len); 40 TEST_ASSERT(mbedtls_chacha20_setkey(&ctx, key_str->x) == 0); 42 TEST_ASSERT(mbedtls_chacha20_starts(&ctx, nonce_str->x, counter) == 0); 45 TEST_ASSERT(mbedtls_chacha20_update(&ctx, src_str->len, src_str->x, output) == 0); 48 expected_output_str->x, expected_output_str->len); 56 TEST_ASSERT(mbedtls_chacha20_starts(&ctx, nonce_str->x, counter) == 0); 59 TEST_ASSERT(mbedtls_chacha20_update(&ctx, 1, src_str->x, output) == 0); 61 src_str->x + 1, output + 1) == 0); 64 expected_output_str->x, expected_output_str->len);
|