/mbedtls-latest/library/ |
D | sha3.c | 104 uint64_t *s = ctx->state; in keccak_f1600() local 113 lane[i] = s[i] ^ s[i + 5] ^ s[i + 10] ^ s[i + 15] ^ s[i + 20]; in keccak_f1600() 117 s[i] ^= t; s[i + 5] ^= t; s[i + 10] ^= t; s[i + 15] ^= t; s[i + 20] ^= t; in keccak_f1600() 120 lane[0] = s[0] ^ s[5] ^ s[10] ^ s[15] ^ s[20]; in keccak_f1600() 121 lane[1] = s[1] ^ s[6] ^ s[11] ^ s[16] ^ s[21]; in keccak_f1600() 122 lane[2] = s[2] ^ s[7] ^ s[12] ^ s[17] ^ s[22]; in keccak_f1600() 123 lane[3] = s[3] ^ s[8] ^ s[13] ^ s[18] ^ s[23]; in keccak_f1600() 124 lane[4] = s[4] ^ s[9] ^ s[14] ^ s[19] ^ s[24]; in keccak_f1600() 127 s[0] ^= t; s[5] ^= t; s[10] ^= t; s[15] ^= t; s[20] ^= t; in keccak_f1600() 130 s[1] ^= t; s[6] ^= t; s[11] ^= t; s[16] ^= t; s[21] ^= t; in keccak_f1600() [all …]
|
D | bn_mul.h | 126 : "=m" (t), "=m" (c), "=m" (d), "=m" (s) \ 127 : "m" (t), "m" (s), "m" (d), "m" (c), "m" (b) \ 204 : "=m" (t), "=m" (c), "=m" (d), "=m" (s) \ 205 : "m" (t), "m" (s), "m" (d), "m" (c), "m" (b) \ 232 : "+c" (c), "+D" (d), "+S" (s), "+m" (*(uint64_t (*)[16]) d) \ 233 : "b" (b), "m" (*(const uint64_t (*)[16]) s) \ 251 do { uintptr_t muladdc_d = (uintptr_t) d, muladdc_s = (uintptr_t) s; asm( 269 : "r" (b), "m" (*(const uint64_t (*)[16]) s) \ 271 ); d = (mbedtls_mpi_uint *)muladdc_d; s = (mbedtls_mpi_uint *)muladdc_s; } while (0); 298 : "=m" (c), "=m" (d), "=m" (s) \ [all …]
|
D | bignum.c | 71 X_is_negative = mbedtls_ct_bool((X->s & 2) >> 1); in mbedtls_mpi_lt_mpi_ct() 72 Y_is_negative = mbedtls_ct_bool((Y->s & 2) >> 1); in mbedtls_mpi_lt_mpi_ct() 129 X->s = mbedtls_ct_mpi_sign_if(do_assign, Y->s, X->s); in mbedtls_mpi_safe_cond_assign() 154 int s; in mbedtls_mpi_safe_cond_swap() local 165 s = X->s; in mbedtls_mpi_safe_cond_swap() 166 X->s = mbedtls_ct_mpi_sign_if(do_swap, Y->s, X->s); in mbedtls_mpi_safe_cond_swap() 167 Y->s = mbedtls_ct_mpi_sign_if(do_swap, s, Y->s); in mbedtls_mpi_safe_cond_swap() 183 X->s = 1; in mbedtls_mpi_init() 201 X->s = 1; in mbedtls_mpi_free() 291 X->s = 1; in mbedtls_mpi_resize_clear() [all …]
|
D | ecdsa.c | 244 mbedtls_mpi *r, mbedtls_mpi *s, in mbedtls_ecdsa_sign_restartable() argument 352 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(s, pr, d)); in mbedtls_ecdsa_sign_restartable() 353 MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(&e, &e, s)); in mbedtls_ecdsa_sign_restartable() 357 MBEDTLS_MPI_CHK(mbedtls_mpi_inv_mod(s, pk, &grp->N)); in mbedtls_ecdsa_sign_restartable() 358 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(s, s, &e)); in mbedtls_ecdsa_sign_restartable() 359 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_mpi(s, s, &grp->N)); in mbedtls_ecdsa_sign_restartable() 360 } while (mbedtls_mpi_cmp_int(s, 0) == 0); in mbedtls_ecdsa_sign_restartable() 380 int mbedtls_ecdsa_sign(mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, in mbedtls_ecdsa_sign() argument 385 return mbedtls_ecdsa_sign_restartable(grp, r, s, d, buf, blen, in mbedtls_ecdsa_sign() 398 mbedtls_mpi *r, mbedtls_mpi *s, in mbedtls_ecdsa_sign_det_restartable() argument [all …]
|
D | constant_time_impl.h | 146 mbedtls_ct_uint_t s; in mbedtls_ct_bool() local 151 [s] "=&r" (s), in mbedtls_ct_bool() 158 uint32_t s; in mbedtls_ct_bool() 165 [s] "=&l" (s), in mbedtls_ct_bool() 173 uint64_t s; in mbedtls_ct_bool() 179 [s] "=&a" (s) in mbedtls_ct_bool() 184 return (mbedtls_ct_condition_t) s; in mbedtls_ct_bool() 186 uint32_t s; in mbedtls_ct_bool() 192 [s] "=&c" (s), in mbedtls_ct_bool() 330 uint64_t s; in mbedtls_ct_uint_lt() [all …]
|
D | x509_create.c | 37 #define ADD_STRLEN(s) s, sizeof(s) - 1 argument 138 static int parse_attribute_value_string(const char *s, in parse_attribute_value_string() argument 144 const char *end = s + len; in parse_attribute_value_string() 148 for (c = s; c < end; c++) { in parse_attribute_value_string() 202 static int parse_attribute_value_hex_der_encoded(const char *s, in parse_attribute_value_hex_der_encoded() argument 235 int c = hexpair_to_int(s + 2 * i); in parse_attribute_value_hex_der_encoded() 285 const char *s = name, *c = s; in mbedtls_x509_string_to_names() local 286 const char *end = s + strlen(s); in mbedtls_x509_string_to_names() 300 if ((attr_descr = x509_attr_descr_from_name(s, (size_t) (c - s))) == NULL) { in mbedtls_x509_string_to_names() 301 if ((mbedtls_oid_from_numeric_string(&oid, s, (size_t) (c - s))) != 0) { in mbedtls_x509_string_to_names() [all …]
|
D | platform.c | 70 int mbedtls_platform_win32_snprintf(char *s, size_t n, const char *fmt, ...) in mbedtls_platform_win32_snprintf() argument 76 ret = mbedtls_vsnprintf(s, n, fmt, argp); in mbedtls_platform_win32_snprintf() 88 static int platform_snprintf_uninit(char *s, size_t n, in platform_snprintf_uninit() argument 91 ((void) s); in platform_snprintf_uninit() 100 int (*mbedtls_snprintf)(char *s, size_t n, 104 int mbedtls_platform_set_snprintf(int (*snprintf_func)(char *s, size_t n, in mbedtls_platform_set_snprintf() argument 115 int mbedtls_platform_win32_vsnprintf(char *s, size_t n, const char *fmt, va_list arg) in mbedtls_platform_win32_vsnprintf() argument 120 if (s == NULL || n == 0 || fmt == NULL) { in mbedtls_platform_win32_vsnprintf() 125 ret = vsnprintf_s(s, n, _TRUNCATE, fmt, arg); in mbedtls_platform_win32_vsnprintf() 127 ret = vsnprintf(s, n, fmt, arg); in mbedtls_platform_win32_vsnprintf() [all …]
|
D | pem.c | 47 static int pem_get_iv(const unsigned char *s, unsigned char *iv, in pem_get_iv() argument 54 for (i = 0; i < iv_len * 2; i++, s++) { in pem_get_iv() 55 if (*s >= '0' && *s <= '9') { in pem_get_iv() 56 j = *s - '0'; in pem_get_iv() 58 if (*s >= 'A' && *s <= 'F') { in pem_get_iv() 59 j = *s - '7'; in pem_get_iv() 61 if (*s >= 'a' && *s <= 'f') { in pem_get_iv() 62 j = *s - 'W'; in pem_get_iv()
|
D | psa_crypto_ecp.c | 375 mbedtls_mpi r, s; in mbedtls_psa_ecdsa_sign_hash() local 388 mbedtls_mpi_init(&s); in mbedtls_psa_ecdsa_sign_hash() 400 &ecp->grp, &r, &s, in mbedtls_psa_ecdsa_sign_hash() 411 MBEDTLS_MPI_CHK(mbedtls_ecdsa_sign(&ecp->grp, &r, &s, &ecp->d, in mbedtls_psa_ecdsa_sign_hash() 420 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&s, in mbedtls_psa_ecdsa_sign_hash() 425 mbedtls_mpi_free(&s); in mbedtls_psa_ecdsa_sign_hash() 460 mbedtls_mpi r, s; in mbedtls_psa_ecdsa_verify_hash() local 475 mbedtls_mpi_init(&s); in mbedtls_psa_ecdsa_verify_hash() 489 status = mbedtls_to_psa_error(mbedtls_mpi_read_binary(&s, in mbedtls_psa_ecdsa_verify_hash() 503 &r, &s)); in mbedtls_psa_ecdsa_verify_hash() [all …]
|
D | x509.c | 823 char s[MBEDTLS_X509_MAX_DN_NAME_SIZE], *p; in mbedtls_x509_dn_gets() local 826 memset(s, 0, sizeof(s)); in mbedtls_x509_dn_gets() 864 s[0] = '#'; in mbedtls_x509_dn_gets() 877 if (j + 1 >= sizeof(s) - 1) { in mbedtls_x509_dn_gets() 883 s[j++] = nibble_to_hex_digit(highbits); in mbedtls_x509_dn_gets() 884 s[j++] = nibble_to_hex_digit(lowbits); in mbedtls_x509_dn_gets() 887 if (j + 1 >= sizeof(s) - 1) { in mbedtls_x509_dn_gets() 893 s[j++] = nibble_to_hex_digit(highbits); in mbedtls_x509_dn_gets() 894 s[j++] = nibble_to_hex_digit(lowbits); in mbedtls_x509_dn_gets() 898 if (j >= sizeof(s) - 1) { in mbedtls_x509_dn_gets() [all …]
|
D | poly1305.c | 213 d = (uint64_t) acc0 + ctx->s[0]; in poly1305_compute_mac() 215 d = (uint64_t) acc1 + ctx->s[1] + (d >> 32U); in poly1305_compute_mac() 217 d = (uint64_t) acc2 + ctx->s[2] + (d >> 32U); in poly1305_compute_mac() 219 acc3 += ctx->s[3] + (uint32_t) (d >> 32U); in poly1305_compute_mac() 251 ctx->s[0] = MBEDTLS_GET_UINT32_LE(key, 16); in mbedtls_poly1305_starts() 252 ctx->s[1] = MBEDTLS_GET_UINT32_LE(key, 20); in mbedtls_poly1305_starts() 253 ctx->s[2] = MBEDTLS_GET_UINT32_LE(key, 24); in mbedtls_poly1305_starts() 254 ctx->s[3] = MBEDTLS_GET_UINT32_LE(key, 28); in mbedtls_poly1305_starts()
|
/mbedtls-latest/3rdparty/p256-m/p256-m/ |
D | p256-m.c | 875 uint32_t m[8], s[8], u[8]; in point_double() local 878 m256_mul_p(s, z, z); in point_double() 879 m256_add_p(m, x, s); in point_double() 880 m256_sub_p(u, x, s); in point_double() 881 m256_mul_p(s, m, u); in point_double() 882 m256_add_p(m, s, s); in point_double() 883 m256_add_p(m, m, s); in point_double() 888 m256_mul_p(s, x, u); in point_double() 889 m256_add_p(s, s, s); in point_double() 897 m256_sub_p(x, x, s); in point_double() [all …]
|
D | README.md | 2 only a subset of p256-m's files are present in Mbed TLS, this README may refer 6 especially suited to constrained 32-bit environments. It's written in standard 63 header file, it's less than 700 lines of code, and more lines of comments 117 function is not cryptographically secure, then neither is p256-m's key 136 **What's included:** 140 - The code has no dependency on libc functions or the toolchain's runtime 144 **What's excluded:** 151 p256-m doesn't use any dynamic memory (on the heap), only the stack. Here's 183 certificates (otherwise, add one 'verify' for each link in the peer's 196 [TinyCrypt](https://github.com/intel/tinycrypt), as it's also a standalone [all …]
|
/mbedtls-latest/3rdparty/everest/library/kremlib/ |
D | FStar_UInt128_extracted.c | 111 static uint64_t FStar_UInt128_add_u64_shift_left(uint64_t hi, uint64_t lo, uint32_t s) in FStar_UInt128_add_u64_shift_left() argument 113 return (hi << s) + (lo >> (FStar_UInt128_u32_64 - s)); in FStar_UInt128_add_u64_shift_left() 116 static uint64_t FStar_UInt128_add_u64_shift_left_respec(uint64_t hi, uint64_t lo, uint32_t s) in FStar_UInt128_add_u64_shift_left_respec() argument 118 return FStar_UInt128_add_u64_shift_left(hi, lo, s); in FStar_UInt128_add_u64_shift_left_respec() 122 FStar_UInt128_shift_left_small(FStar_UInt128_uint128 a, uint32_t s) in FStar_UInt128_shift_left_small() argument 124 if (s == (uint32_t)0U) in FStar_UInt128_shift_left_small() 131 flat = { a.low << s, FStar_UInt128_add_u64_shift_left_respec(a.high, a.low, s) }; in FStar_UInt128_shift_left_small() 137 FStar_UInt128_shift_left_large(FStar_UInt128_uint128 a, uint32_t s) in FStar_UInt128_shift_left_large() argument 139 FStar_UInt128_uint128 flat = { (uint64_t)0U, a.low << (s - FStar_UInt128_u32_64) }; in FStar_UInt128_shift_left_large() 143 FStar_UInt128_uint128 FStar_UInt128_shift_left(FStar_UInt128_uint128 a, uint32_t s) in FStar_UInt128_shift_left() argument [all …]
|
/mbedtls-latest/tests/suites/ |
D | test_suite_ecdsa.function | 15 mbedtls_mpi d, r, s; 21 mbedtls_mpi_init(&d); mbedtls_mpi_init(&r); mbedtls_mpi_init(&s); 30 TEST_ASSERT(mbedtls_ecdsa_sign(&grp, &r, &s, &d, buf, sizeof(buf), 33 TEST_ASSERT(mbedtls_ecdsa_verify(&grp, buf, sizeof(buf), &Q, &r, &s) == 0); 38 mbedtls_mpi_free(&d); mbedtls_mpi_free(&r); mbedtls_mpi_free(&s); 47 mbedtls_mpi d, r, s; 53 mbedtls_mpi_init(&d); mbedtls_mpi_init(&r); mbedtls_mpi_init(&s); 65 TEST_ASSERT(mbedtls_ecdsa_sign(&grp, &r, &s, &d, buf, sizeof(buf), 68 TEST_ASSERT(mbedtls_ecdsa_verify(&grp, buf, sizeof(buf), &Q, &r, &s) == 0); 73 mbedtls_mpi_free(&d); mbedtls_mpi_free(&r); mbedtls_mpi_free(&s); [all …]
|
D | test_suite_psa_crypto_util.data | 23 ECDSA Raw -> DER, 256bit, Null s 31 ECDSA Raw -> DER, 256bit, s with MSb set 35 ECDSA Raw -> DER, 256bit, both r and s with MSb set 39 ECDSA Raw -> DER, 256bit, r and s only 1 byte of data 43 ECDSA Raw -> DER, 256bit, r and s only 1 byte of data with MSb set 51 ECDSA Raw -> DER, 256bit, Invalid raw signature (r and s 1 byte shorter) 59 ECDSA Raw -> DER, 256bit, Invalid raw signature (r and s 1 byte longer) 101 ECDSA DER -> Raw, 256bit, Wrong s integer length (1 byte smaller than the actual size) 105 ECDSA DER -> Raw, 256bit, Wrong s integer length (1 byte larger than the actual size) 121 ECDSA DER -> Raw, 256bit, Invalid s all zeros [all …]
|
D | host_test.function | 16 "Expected string (with \"\") for parameter and got: %s\n", *str); 44 "Expected integer for parameter and got: %s\n", str); 48 mbedtls_fprintf(stderr, "Integer out of range: %s\n", str); 61 "Usage: %s [OPTIONS] files...\n\n" \ 66 " %s\n\n" \ 289 ret = mbedtls_snprintf(buf, n, "%s", "123"); 361 mbedtls_fprintf(outcome_file, "%s;%s;%s;%s;", 410 mbedtls_fprintf(outcome_file, "FAIL;%s:%d:%s", 464 mbedtls_fprintf(stderr, "%s: note: chdir(\"%s\") failed.\n", 529 * structures, which should work on every modern platform. Let's be sure. [all …]
|
D | test_suite_bignum_core.function | 327 uint32_t s = (sizeof(mbedtls_mpi_uint) * 8 - leading_zeros - trailing_zeros); 328 x = ((((mbedtls_mpi_uint) 1) << s) - 1) << trailing_zeros; 636 TEST_EQUAL(1, A.s); 637 TEST_EQUAL(1, B.s); 638 TEST_EQUAL(1, X.s); 647 /* Now let's get arrays of mbedtls_mpi_uints, rather than MPI structures */ 655 /* Populate the arrays. As the mbedtls_mpi_uint[]s in mbedtls_mpis (and as 708 /* We are testing A += B * s; A, B are MPIs, s is a scalar. 710 * However, we encode s as an MPI in the .data file as the test framework 736 /* The MPI encoding of scalar s must be only 1 limb */ [all …]
|
/mbedtls-latest/tests/src/ |
D | bignum_helpers.c | 79 const char *s, in mbedtls_test_read_mpi_modulus() argument 87 int ret = mbedtls_test_read_mpi_core(&p, &limbs, s); in mbedtls_test_read_mpi_modulus() 116 int mbedtls_test_read_mpi(mbedtls_mpi *X, const char *s) in mbedtls_test_read_mpi() argument 122 if (s[0] == '-') { in mbedtls_test_read_mpi() 123 ++s; in mbedtls_test_read_mpi() 128 if (s[0] == 0) { in mbedtls_test_read_mpi() 132 int ret = mbedtls_mpi_read_string(X, 16, s); in mbedtls_test_read_mpi() 140 X->s = -1; in mbedtls_test_read_mpi()
|
/mbedtls-latest/scripts/ |
D | code_style.py | 52 return frozenset(word for s in checks for word in s.split()) 110 committed_changed_files += ["framework/" + s for s in output.split()] 122 uncommitted_changed_files += ["framework/" + s for s in output.split()] 126 src_files += ["framework/" + s for s in framework_src_files]
|
/mbedtls-latest/include/mbedtls/ |
D | ecdsa.h | 161 int mbedtls_ecdsa_sign(mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, 207 mbedtls_mpi *s, const mbedtls_mpi *d, 271 mbedtls_mpi *r, mbedtls_mpi *s, 334 mbedtls_mpi *r, mbedtls_mpi *s, 376 const mbedtls_mpi *s); 418 const mbedtls_mpi *s,
|
D | platform.h | 234 int mbedtls_platform_win32_snprintf(char *s, size_t n, const char *fmt, ...); 238 extern int (*mbedtls_snprintf)(char *s, size_t n, const char *format, ...); 248 int mbedtls_platform_set_snprintf(int (*snprintf_func)(char *s, size_t n, 271 int mbedtls_platform_win32_vsnprintf(char *s, size_t n, const char *fmt, va_list arg); 276 extern int (*mbedtls_vsnprintf)(char *s, size_t n, const char *format, va_list arg); 285 int mbedtls_platform_set_vsnprintf(int (*vsnprintf_func)(char *s, size_t n,
|
/mbedtls-latest/docs/architecture/ |
D | psa-storage-resilience.md | 63 …s perspective since the core has not committed to the key's existence, but the core needs to take … 73 1. The core calls the driver's `"allocate_key"` entry point. 76 4. The core calls the driver's key creation entry point, passing it the driver's chosen identifier … 89 2. The core calls the driver's `"destroy_key"` entry point. 117 …has its desired final content (containing the key attributes and the driver's key identifier). The… 133 When the core starts, it needs to know about transaction(s) that need to be resumed. This informati… 137 …uire a rewind in the secure element). It may call the secure element driver's `"get_key_attributes… 140 …quire a new call to `"allocate_key"` which will in general changing the key's driver identifier, w… 143 …* Committing means finishing the update of the core's persistent state, as would have been done if… 146 …* Committing means finishing the update of the core's persistent state, as would have been done if… [all …]
|
/mbedtls-latest/tests/scripts/ |
D | translate_ciphers.py | 65 for s, g_exp, o_exp, m_exp in ciphers: 68 g = translate_gnutls(s) 72 o = translate_ossl(s) 76 m = translate_mbedtls(s)
|
/mbedtls-latest/docs/proposed/ |
D | psa-driver-wrappers-codegen-migration-guide.md | 22 ### What's critical for a migrating user 24 …a2 ) to render templates based on drivers that are defined using a Driver description JSON file(s). 26 While that is the larger goal, for version 1.1 here's what's changed 28 #### What's changed
|