/mbedtls-latest/3rdparty/everest/library/kremlib/ |
D | FStar_UInt128_extracted.c | 25 static uint64_t FStar_UInt128_constant_time_carry(uint64_t a, uint64_t b) in FStar_UInt128_constant_time_carry() argument 27 return (a ^ ((a ^ b) | ((a - b) ^ b))) >> (uint32_t)63U; in FStar_UInt128_constant_time_carry() 30 static uint64_t FStar_UInt128_carry(uint64_t a, uint64_t b) in FStar_UInt128_carry() argument 32 return FStar_UInt128_constant_time_carry(a, b); in FStar_UInt128_carry() 35 FStar_UInt128_uint128 FStar_UInt128_add(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b) in FStar_UInt128_add() argument 38 flat = { a.low + b.low, a.high + b.high + FStar_UInt128_carry(a.low + b.low, b.low) }; in FStar_UInt128_add() 43 FStar_UInt128_add_underspec(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b) in FStar_UInt128_add_underspec() argument 46 flat = { a.low + b.low, a.high + b.high + FStar_UInt128_carry(a.low + b.low, b.low) }; in FStar_UInt128_add_underspec() 50 FStar_UInt128_uint128 FStar_UInt128_add_mod(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b) in FStar_UInt128_add_mod() argument 53 flat = { a.low + b.low, a.high + b.high + FStar_UInt128_carry(a.low + b.low, b.low) }; in FStar_UInt128_add_mod() [all …]
|
D | FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.c | 13 uint64_t FStar_UInt64_eq_mask(uint64_t a, uint64_t b) in FStar_UInt64_eq_mask() argument 15 uint64_t x = a ^ b; in FStar_UInt64_eq_mask() 22 uint64_t FStar_UInt64_gte_mask(uint64_t a, uint64_t b) in FStar_UInt64_gte_mask() argument 25 uint64_t y = b; in FStar_UInt64_gte_mask() 35 uint32_t FStar_UInt32_eq_mask(uint32_t a, uint32_t b) in FStar_UInt32_eq_mask() argument 37 uint32_t x = a ^ b; in FStar_UInt32_eq_mask() 44 uint32_t FStar_UInt32_gte_mask(uint32_t a, uint32_t b) in FStar_UInt32_gte_mask() argument 47 uint32_t y = b; in FStar_UInt32_gte_mask() 57 uint16_t FStar_UInt16_eq_mask(uint16_t a, uint16_t b) in FStar_UInt16_eq_mask() argument 59 uint16_t x = a ^ b; in FStar_UInt16_eq_mask() [all …]
|
/mbedtls-latest/tests/suites/ |
D | test_suite_bignum.generated.data | 16 mpi_add_mpi:"":"7b":"7b" 19 mpi_add_mpi:"":"-7b":"-7b" 46 mpi_add_mpi:"0":"7b":"7b" 49 mpi_add_mpi:"0":"-7b":"-7b" 76 mpi_add_mpi:"-":"7b":"7b" 79 mpi_add_mpi:"-":"-7b":"-7b" 106 mpi_add_mpi:"-0":"7b":"7b" 109 mpi_add_mpi:"-0":"-7b":"-7b" 124 mpi_add_mpi:"7b":"":"7b" 127 mpi_add_mpi:"7b":"0":"7b" [all …]
|
D | test_suite_common.function | 5 unsigned char *b, 12 b[i] = (unsigned char) i * 3 + 1; 23 unsigned char *a = NULL, *b = NULL, *r1 = NULL, *r2 = NULL; 25 TEST_CALLOC(b, n + 1); 30 fill_arrays(a, b, r1, r2, n); 32 r1[i] = a[i] ^ b[i]; 34 mbedtls_xor(r2, a, b, n); 38 fill_arrays(a, b, r1, r2, n); 40 r1[i] = r1[i] ^ b[i]; 42 mbedtls_xor(r2, r2, b, n); [all …]
|
D | test_suite_debug.data | 32 …value' (16 bytes)\nMyFile(0999)\: 0000\: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f .......… 35 …value' (17 bytes)\nMyFile(0999)\: 0000\: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f .......… 38 …b 0c 0d 0e 0f ................\nMyFile(0999)\: 0010\: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d … 53 …b 10 7c 09\nMyFile(0999)\: 18 2b 5e dc d9 55 ad ac 41 8b f4 91 8e 28 89 af\nMyFile(0999)\: 48 e1… 56 …b 10 7c\nMyFile(0999)\: 09 18 2b 5e dc d9 55 ad ac 41 8b f4 91 8e 28 89\nMyFile(0999)\: af 48 e1… 59 …b 10 7c\nMyFile(0999)\: 09 18 2b 5e dc d9 55 ad ac 41 8b f4 91 8e 28 89\nMyFile(0999)\: af 48 e1… 63 …b fd 36 ee 82 65 2e\nMyFile(0999)\: 15 61 5e 89 bf b8 e8 45 90 db ee 88 16 52 d3 f1\nMyFile(0999)… 67 …b 34 41 37 58 2f 87 56 fe fc 89 ba 29 43\nMyFile(0999)\: 4b 4e e0 6e c3 0e 57 53 33 39 58 d4 52 b…
|
D | test_suite_alignment.function | 136 uint64_t b = (r & ((uint64_t) 0xff << s2)) >> s2; 137 TEST_EQUAL(a, b); 168 for (size_t b = 0; b < 8; b++) { 169 uint8_t expected = b; 170 uint8_t actual = b + 1; 171 switch (b) { 201 for (size_t b = 0; b < 4; b++) { 202 uint8_t expected = b; 203 uint8_t actual = b + 1; 204 switch (b) { [all …]
|
D | test_suite_bignum_random.function | 62 /* Test whether bytes represents (in big-endian base 256) a number b that 63 * is significantly above a power of 2. That is, b must not have a long run 66 * Let n be the bit-size of b, i.e. the integer such that 2^n <= b < 2^{n+1}. 67 * This function returns 1 if, when drawing a number between 0 and b, 69 * This probability is (b - 2^n) / b and this function checks that this 101 /* At this point, x = floor((b - 2^n) / 2^(n-8)). b is significantly above 279 size_t b; 280 /* If upper_bound is small, stats[b] is the number of times the value b 281 * has been generated. Otherwise stats[b] is the number of times a 282 * value with bit b set has been generated. */ [all …]
|
D | test_suite_bignum_mod.function | 9 #define TEST_COMPARE_MPI_RESIDUES(a, b) \ 11 (b).p, (b).limbs * sizeof(mbedtls_mpi_uint)) 238 mbedtls_mpi_mod_residue b = { NULL, 0 }; 254 TEST_EQUAL(0, test_read_residue(&b, &m, input_B, expected_ret != 0)); 267 mbedtls_mpi_mod_sub(&x, &a, &b, &m)); 279 mbedtls_mpi_mod_sub(&x, &a, &b, &m)); 285 /* Negative testing with too many/too few limbs in a and b is covered by 293 /* a - b => Correct result, or expected error */ 294 TEST_EQUAL(expected_ret, mbedtls_mpi_mod_sub(&x, &a, &b, &m)); 301 /* a - b: alias x to a => Correct result */ [all …]
|
D | test_suite_constant_time.function | 202 uint8_t *a = NULL, *b = NULL; 205 TEST_CALLOC(b, size); 208 TEST_CF_SECRET(b, size); 209 int result = mbedtls_ct_memcmp(a, b, size); 211 TEST_CF_PUBLIC(b, size); 223 TEST_CF_SECRET(b, size); 224 result = mbedtls_ct_memcmp(a, b, size); 226 TEST_CF_PUBLIC(b, size); 238 mbedtls_free(b); 245 uint8_t *a = NULL, *b = NULL; [all …]
|
D | test_suite_bignum_core.function | 623 mbedtls_mpi_uint *b = NULL; 651 TEST_CALLOC(b, bytes); 660 memcpy(b, B.p, B.n * sizeof(mbedtls_mpi_uint)); 663 /* 1a) r = a - b => we should get the correct carry */ 664 TEST_EQUAL(carry, mbedtls_mpi_core_sub(r, a, b, limbs)); 666 /* 1b) r = a - b => we should get the correct result */ 669 /* 2 and 3 test "r may be aliased to a or b" */ 670 /* 2a) r = a; r -= b => we should get the correct carry (use r to avoid clobbering a) */ 672 TEST_EQUAL(carry, mbedtls_mpi_core_sub(r, r, b, limbs)); 674 /* 2b) r -= b => we should get the correct result */ [all …]
|
/mbedtls-latest/3rdparty/everest/include/everest/kremlin/ |
D | c_endianness.h | 159 inline static uint16_t load16(uint8_t *b) { in load16() argument 161 memcpy(&x, b, 2); in load16() 165 inline static uint32_t load32(uint8_t *b) { in load32() argument 167 memcpy(&x, b, 4); in load32() 171 inline static uint64_t load64(uint8_t *b) { in load64() argument 173 memcpy(&x, b, 8); in load64() 177 inline static void store16(uint8_t *b, uint16_t i) { in store16() argument 178 memcpy(b, &i, 2); in store16() 181 inline static void store32(uint8_t *b, uint32_t i) { in store32() argument 182 memcpy(b, &i, 4); in store32() [all …]
|
/mbedtls-latest/library/ |
D | bn_mul.h | 38 #define MBEDTLS_BYTES_TO_T_UINT_4(a, b, c, d) \ argument 40 ((mbedtls_mpi_uint) (b) << 8) | \ 44 #define MBEDTLS_BYTES_TO_T_UINT_2(a, b) \ argument 45 MBEDTLS_BYTES_TO_T_UINT_4(a, b, 0, 0) 47 #define MBEDTLS_BYTES_TO_T_UINT_8(a, b, c, d, e, f, g, h) \ argument 48 MBEDTLS_BYTES_TO_T_UINT_4(a, b, c, d), \ 53 #define MBEDTLS_BYTES_TO_T_UINT_8(a, b, c, d, e, f, g, h) \ argument 55 ((mbedtls_mpi_uint) (b) << 8) | \ 63 #define MBEDTLS_BYTES_TO_T_UINT_4(a, b, c, d) \ argument 64 MBEDTLS_BYTES_TO_T_UINT_8(a, b, c, d, 0, 0, 0, 0) [all …]
|
D | aria.c | 109 static inline void aria_a(uint32_t *a, uint32_t *b, in aria_a() argument 113 ta = *b; // 4567 in aria_a() 114 *b = *a; // 0123 in aria_a() 120 tc = ARIA_P2(*b); // 2301 in aria_a() 124 *b ^= ta ^ tb; // 0123+2301+5476+89ab+ba98+efcd+fedc OUT in aria_a() 141 static inline void aria_sl(uint32_t *a, uint32_t *b, in aria_sl() argument 150 *b = ((uint32_t) sa[MBEDTLS_BYTE_0(*b)]) ^ in aria_sl() 151 (((uint32_t) sb[MBEDTLS_BYTE_1(*b)]) << 8) ^ in aria_sl() 152 (((uint32_t) sc[MBEDTLS_BYTE_2(*b)]) << 16) ^ in aria_sl() 153 (((uint32_t) sd[MBEDTLS_BYTE_3(*b)]) << 24); in aria_sl() [all …]
|
D | aesce.c | 414 static inline poly128_t vmull_p64(poly64_t a, poly64_t b) in vmull_p64() argument 417 asm ("vmull.p64 %[r], %[a], %[b]" : [r] "=w" (r) : [a] "w" (a), [b] "w" (b) :); in vmull_p64() 424 static inline poly128_t vmull_high_p64(poly64x2_t a, poly64x2_t b) in vmull_high_p64() argument 427 (poly64_t) (vget_high_u64((uint64x2_t) b))); in vmull_high_p64() 490 #define MBEDTLS_VMULL_P64(a, b) vmull_p64((poly64_t) a, (poly64_t) b) argument 495 #define MBEDTLS_VMULL_P64(a, b) vmull_p64(a, b) argument 498 static inline uint8x16_t pmull_low(uint8x16_t a, uint8x16_t b) in pmull_low() argument 504 (poly64_t) vget_low_p64(vreinterpretq_p64_u8(b)) in pmull_low() 508 static inline uint8x16_t pmull_high(uint8x16_t a, uint8x16_t b) in pmull_high() argument 512 vreinterpretq_p64_u8(b))); in pmull_high() [all …]
|
D | common.h | 188 const unsigned char *b, in mbedtls_xor() argument 198 uint8x16_t v2 = vld1q_u8(b + i); in mbedtls_xor() 214 uint64_t x = mbedtls_get_unaligned_uint64(a + i) ^ mbedtls_get_unaligned_uint64(b + i); in mbedtls_xor() 224 uint32_t x = mbedtls_get_unaligned_uint32(a + i) ^ mbedtls_get_unaligned_uint32(b + i); in mbedtls_xor() 235 r[i] = a[i] ^ b[i]; in mbedtls_xor() 270 const unsigned char *b, in mbedtls_xor_no_simd() argument 278 uint64_t x = mbedtls_get_unaligned_uint64(a + i) ^ mbedtls_get_unaligned_uint64(b + i); 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() 303 r[i] = a[i] ^ b[i]; in mbedtls_xor_no_simd()
|
D | chacha20.c | 51 size_t b, in chacha20_quarter_round() argument 56 state[a] += state[b]; in chacha20_quarter_round() 62 state[b] ^= state[c]; in chacha20_quarter_round() 63 state[b] = ROTL32(state[b], 12); in chacha20_quarter_round() 66 state[a] += state[b]; in chacha20_quarter_round() 72 state[b] ^= state[c]; in chacha20_quarter_round() 73 state[b] = ROTL32(state[b], 7); in chacha20_quarter_round()
|
D | constant_time.c | 69 const void *b, in mbedtls_ct_memcmp() argument 80 volatile const unsigned char *B = (volatile const unsigned char *) b; in mbedtls_ct_memcmp() 122 const void *b, in mbedtls_ct_memcmp_partial() argument 130 volatile const unsigned char *B = (volatile const unsigned char *) b; in mbedtls_ct_memcmp_partial() 199 uint64_t b = mbedtls_get_unaligned_uint64(src2 + i) & not_mask; in mbedtls_ct_memcpy_if() local 200 mbedtls_put_unaligned_uint64(dest + i, a | b); in mbedtls_ct_memcpy_if() 205 uint32_t b = mbedtls_get_unaligned_uint32(src2 + i) & not_mask; in mbedtls_ct_memcpy_if() local 206 mbedtls_put_unaligned_uint32(dest + i, a | b); in mbedtls_ct_memcpy_if()
|
D | bignum.c | 1161 int mbedtls_mpi_add_int(mbedtls_mpi *X, const mbedtls_mpi *A, mbedtls_mpi_sint b) in mbedtls_mpi_add_int() argument 1166 p[0] = mpi_sint_abs(b); in mbedtls_mpi_add_int() 1167 B.s = TO_SIGN(b); in mbedtls_mpi_add_int() 1177 int mbedtls_mpi_sub_int(mbedtls_mpi *X, const mbedtls_mpi *A, mbedtls_mpi_sint b) in mbedtls_mpi_sub_int() argument 1182 p[0] = mpi_sint_abs(b); in mbedtls_mpi_sub_int() 1183 B.s = TO_SIGN(b); in mbedtls_mpi_sub_int() 1253 int mbedtls_mpi_mul_int(mbedtls_mpi *X, const mbedtls_mpi *A, mbedtls_mpi_uint b) in mbedtls_mpi_mul_int() argument 1261 if (b == 0 || n == 0) { in mbedtls_mpi_mul_int() 1280 mbedtls_mpi_core_mla(X->p, X->n, A->p, n, b - 1); in mbedtls_mpi_mul_int() 1518 mbedtls_mpi_sint b) in mbedtls_mpi_div_int() argument [all …]
|
/mbedtls-latest/3rdparty/everest/include/everest/kremlib/ |
D | FStar_UInt128.h | 26 FStar_UInt128_uint128 FStar_UInt128_add(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); 29 FStar_UInt128_add_underspec(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); 31 FStar_UInt128_uint128 FStar_UInt128_add_mod(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); 33 FStar_UInt128_uint128 FStar_UInt128_sub(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); 36 FStar_UInt128_sub_underspec(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); 38 FStar_UInt128_uint128 FStar_UInt128_sub_mod(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); 40 FStar_UInt128_uint128 FStar_UInt128_logand(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); 42 FStar_UInt128_uint128 FStar_UInt128_logxor(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); 44 FStar_UInt128_uint128 FStar_UInt128_logor(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); 52 bool FStar_UInt128_eq(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); [all …]
|
D | FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.h | 77 uint64_t FStar_UInt64_eq_mask(uint64_t a, uint64_t b); 79 uint64_t FStar_UInt64_gte_mask(uint64_t a, uint64_t b); 141 uint32_t FStar_UInt32_eq_mask(uint32_t a, uint32_t b); 143 uint32_t FStar_UInt32_gte_mask(uint32_t a, uint32_t b); 205 uint16_t FStar_UInt16_eq_mask(uint16_t a, uint16_t b); 207 uint16_t FStar_UInt16_gte_mask(uint16_t a, uint16_t b); 269 uint8_t FStar_UInt8_eq_mask(uint8_t a, uint8_t b); 271 uint8_t FStar_UInt8_gte_mask(uint8_t a, uint8_t b);
|
/mbedtls-latest/scripts/ |
D | make_generated_files.bat | 6 python scripts\generate_driver_wrappers.py || exit /b 1 7 perl scripts\generate_errors.pl || exit /b 1 8 perl scripts\generate_query_config.pl || exit /b 1 9 perl scripts\generate_features.pl || exit /b 1 10 python scripts\generate_ssl_debug_helpers.py || exit /b 1 11 perl scripts\generate_visualc_files.pl || exit /b 1 12 python scripts\generate_psa_constants.py || exit /b 1 13 python framework\scripts\generate_bignum_tests.py || exit /b 1 14 python framework\scripts\generate_config_tests.py || exit /b 1 15 python framework\scripts\generate_ecp_tests.py || exit /b 1 [all …]
|
/mbedtls-latest/tests/scripts/ |
D | check_files.py | 146 for i, line in enumerate(iter(f.readline, b"")): 170 b'bash': 'sh', 171 b'perl': 'pl', 172 b'python3': 'py', 173 b'sh': 'sh', 193 if first_line.startswith(b'#!'): 221 if f.read(1) != b"\n": 291 return b"\r" in line 305 return not line.endswith(b"\r\n") or b"\r" in line[:-2] 315 return line.rstrip(b"\r\n") != line.rstrip() [all …]
|
/mbedtls-latest/3rdparty/everest/library/ |
D | Hacl_Curve25519.c | 31 static void Hacl_Bignum_Modulo_carry_top(uint64_t *b) in Hacl_Bignum_Modulo_carry_top() argument 33 uint64_t b4 = b[4U]; in Hacl_Bignum_Modulo_carry_top() 34 uint64_t b0 = b[0U]; in Hacl_Bignum_Modulo_carry_top() 37 b[4U] = b4_; in Hacl_Bignum_Modulo_carry_top() 38 b[0U] = b0_; in Hacl_Bignum_Modulo_carry_top() 256 uint64_t *b; in Hacl_Bignum_Crecip_crecip() local 278 b = buf + (uint32_t)10U; in Hacl_Bignum_Crecip_crecip() 280 Hacl_Bignum_Fmul_fmul(c, t0, b); in Hacl_Bignum_Crecip_crecip() 284 Hacl_Bignum_Fmul_fmul(t0, t0, b); in Hacl_Bignum_Crecip_crecip() 289 inline static void Hacl_Bignum_fsum(uint64_t *a, uint64_t *b) in Hacl_Bignum_fsum() argument [all …]
|
/mbedtls-latest/3rdparty/everest/library/legacy/ |
D | Hacl_Curve25519.c | 34 static void Hacl_Bignum_Modulo_carry_top(uint64_t *b) in Hacl_Bignum_Modulo_carry_top() argument 36 uint64_t b4 = b[4U]; in Hacl_Bignum_Modulo_carry_top() 37 uint64_t b0 = b[0U]; in Hacl_Bignum_Modulo_carry_top() 40 b[4U] = b4_; in Hacl_Bignum_Modulo_carry_top() 41 b[0U] = b0_; in Hacl_Bignum_Modulo_carry_top() 298 uint64_t *b; in Hacl_Bignum_Crecip_crecip() local 320 b = buf + (uint32_t)10U; in Hacl_Bignum_Crecip_crecip() 322 Hacl_Bignum_Fmul_fmul(c, t0, b); in Hacl_Bignum_Crecip_crecip() 326 Hacl_Bignum_Fmul_fmul(t0, t0, b); in Hacl_Bignum_Crecip_crecip() 331 inline static void Hacl_Bignum_fsum(uint64_t *a, uint64_t *b) in Hacl_Bignum_fsum() argument [all …]
|
/mbedtls-latest/include/mbedtls/ |
D | bignum.h | 753 mbedtls_mpi_sint b); 768 mbedtls_mpi_sint b); 799 mbedtls_mpi_uint b); 841 mbedtls_mpi_sint b); 880 mbedtls_mpi_sint b);
|