Home
last modified time | relevance | path

Searched refs:bits (Results 1 – 25 of 92) sorted by relevance

1234

/mbedtls-latest/library/
Dpsa_util.c190 size_t *bits) in mbedtls_ecc_group_to_psa() argument
195 *bits = 192; in mbedtls_ecc_group_to_psa()
200 *bits = 224; in mbedtls_ecc_group_to_psa()
205 *bits = 256; in mbedtls_ecc_group_to_psa()
210 *bits = 384; in mbedtls_ecc_group_to_psa()
215 *bits = 521; in mbedtls_ecc_group_to_psa()
220 *bits = 256; in mbedtls_ecc_group_to_psa()
225 *bits = 384; in mbedtls_ecc_group_to_psa()
230 *bits = 512; in mbedtls_ecc_group_to_psa()
235 *bits = 255; in mbedtls_ecc_group_to_psa()
[all …]
Dpsa_crypto_ecp.c40 static int check_ecc_parameters(psa_ecc_family_t family, size_t *bits) in check_ecc_parameters() argument
44 switch (*bits) { in check_ecc_parameters()
52 *bits = 521; in check_ecc_parameters()
58 switch (*bits) { in check_ecc_parameters()
67 switch (*bits) { in check_ecc_parameters()
72 *bits = 255; in check_ecc_parameters()
78 switch (*bits) { in check_ecc_parameters()
213 size_t *key_buffer_length, size_t *bits) in mbedtls_psa_ecp_import_key() argument
220 attributes->bits, in mbedtls_psa_ecp_import_key()
230 *bits = ecp->grp.nbits + 1; in mbedtls_psa_ecp_import_key()
[all …]
Dasn1write.c269 size_t bits) in mbedtls_asn1_write_named_bitstring() argument
276 byte_len = (bits + 7) / 8; in mbedtls_asn1_write_named_bitstring()
277 unused_bits = (byte_len * 8) - bits; in mbedtls_asn1_write_named_bitstring()
284 if (bits != 0) { in mbedtls_asn1_write_named_bitstring()
296 bits--; in mbedtls_asn1_write_named_bitstring()
297 if (bits == 0) { in mbedtls_asn1_write_named_bitstring()
301 if (bits % 8 == 0) { in mbedtls_asn1_write_named_bitstring()
307 return mbedtls_asn1_write_bitstring(p, start, buf, bits); in mbedtls_asn1_write_named_bitstring()
311 const unsigned char *buf, size_t bits) in mbedtls_asn1_write_bitstring() argument
316 byte_len = (bits + 7) / 8; in mbedtls_asn1_write_bitstring()
[all …]
Dpsa_crypto.c306 static int psa_is_dh_key_size_valid(size_t bits) in psa_is_dh_key_size_valid() argument
308 switch (bits) { in psa_is_dh_key_size_valid()
615 size_t bits) in psa_validate_unstructured_key_bit_size() argument
627 if (bits != 128 && bits != 192 && bits != 256) { in psa_validate_unstructured_key_bit_size()
634 if (bits != 128 && bits != 192 && bits != 256) { in psa_validate_unstructured_key_bit_size()
641 if (bits != 128 && bits != 192 && bits != 256) { in psa_validate_unstructured_key_bit_size()
648 if (bits != 64 && bits != 128 && bits != 192) { in psa_validate_unstructured_key_bit_size()
655 if (bits != 256) { in psa_validate_unstructured_key_bit_size()
663 if (bits % 8 != 0) { in psa_validate_unstructured_key_bit_size()
750 size_t *key_buffer_length, size_t *bits) in psa_import_key_into_slot() argument
[all …]
Dssl_tls13_generic.c1496 uint16_t tls_id, size_t *bits, psa_key_type_t *key_type) in mbedtls_ssl_get_psa_ffdh_info_from_tls_id() argument
1501 *bits = 2048; in mbedtls_ssl_get_psa_ffdh_info_from_tls_id()
1507 *bits = 3072; in mbedtls_ssl_get_psa_ffdh_info_from_tls_id()
1513 *bits = 4096; in mbedtls_ssl_get_psa_ffdh_info_from_tls_id()
1519 *bits = 6144; in mbedtls_ssl_get_psa_ffdh_info_from_tls_id()
1525 *bits = 8192; in mbedtls_ssl_get_psa_ffdh_info_from_tls_id()
1547 size_t bits = 0; in mbedtls_ssl_tls13_generate_and_write_xxdh_key_exchange() local
1557 named_group, &key_type, &bits) == PSA_SUCCESS) { in mbedtls_ssl_tls13_generate_and_write_xxdh_key_exchange()
1562 if (mbedtls_ssl_get_psa_ffdh_info_from_tls_id(named_group, &bits, in mbedtls_ssl_tls13_generate_and_write_xxdh_key_exchange()
1572 if (buf_size < PSA_BITS_TO_BYTES(bits)) { in mbedtls_ssl_tls13_generate_and_write_xxdh_key_exchange()
[all …]
Dpsa_crypto_storage.c230 uint8_t bits[2]; member
249 MBEDTLS_PUT_UINT16_LE((uint16_t) attr->bits, storage_format->bits, 0); in psa_format_key_data_for_storage()
309 attr->bits = MBEDTLS_GET_UINT16_LE(storage_format->bits, 0); in psa_parse_key_data_from_storage()
Dpsa_crypto_rsa.c64 size_t bits; in mbedtls_psa_rsa_load_representation() local
85 bits = PSA_BYTES_TO_BITS(mbedtls_rsa_get_len(*p_rsa)); in mbedtls_psa_rsa_load_representation()
86 if (bits > PSA_VENDOR_RSA_MAX_KEY_BITS) { in mbedtls_psa_rsa_load_representation()
113 size_t *key_buffer_length, size_t *bits) in mbedtls_psa_rsa_import_key() argument
127 *bits = (psa_key_bits_t) PSA_BYTES_TO_BITS(mbedtls_rsa_get_len(rsa)); in mbedtls_psa_rsa_import_key()
262 (unsigned int) attributes->bits, in mbedtls_psa_rsa_generate_key()
Dpsa_crypto_ffdh.c170 size_t key_len = PSA_BITS_TO_BYTES(attributes->bits); in mbedtls_psa_ffdh_export_public_key()
241 size_t *key_buffer_length, size_t *bits) in mbedtls_psa_ffdh_import_key() argument
250 *bits = PSA_BYTES_TO_BITS(data_length); in mbedtls_psa_ffdh_import_key()
286 PSA_BITS_TO_BYTES(attributes->bits), &P, &G); in mbedtls_psa_ffdh_key_agreement()
/mbedtls-latest/tests/suites/
Dtest_suite_asn1write.data121 ASN.1 Write mpi, 127*8-1 bits
124 ASN.1 Write mpi, 127*8 bits
127 ASN.1 Write mpi, 127*8+1 bits
130 ASN.1 Write mpi, 255*8-1 bits
133 ASN.1 Write mpi, 255*8 bits
136 ASN.1 Write mpi, 256*8-1 bits
274 ASN.1 Write Named Bitstring / Unused bits #0
277 ASN.1 Write Named Bitstring / Unused bits #1
280 ASN.1 Write Named Bitstring / Unused bits #2
283 ASN.1 Write Named Bitstring / Unused bits #3
[all …]
Dtest_suite_pkwrite.data17 Public key write check EC 192 bits
21 Public key write check EC 192 bits (DER)
25 Public key write check EC 521 bits
29 Public key write check EC 521 bits (DER)
33 Public key write check EC Brainpool 512 bits
37 Public key write check EC Brainpool 512 bits (DER)
73 Private key write check EC 192 bits
77 Private key write check EC 192 bits (DER)
81 Private key write check EC 256 bits (top bit set)
85 Private key write check EC 256 bits (top bit set) (DER)
[all …]
Dtest_suite_debug.data41 mbedtls_debug_print_mpi:"":"MyFile":999:"VALUE":"MyFile(0999)\: value of 'VALUE' (0 bits) is\:\nMyF…
44 …"00000000000000":"MyFile":999:"VALUE":"MyFile(0999)\: value of 'VALUE' (0 bits) is\:\nMyFile(0999)…
46 Debug print mbedtls_mpi #2: 3 bits
47 …"00000000000007":"MyFile":999:"VALUE":"MyFile(0999)\: value of 'VALUE' (3 bits) is\:\nMyFile(0999)…
49 Debug print mbedtls_mpi: 49 bits
50 …01020304050607":"MyFile":999:"VALUE":"MyFile(0999)\: value of 'VALUE' (49 bits) is\:\nMyFile(0999)…
52 Debug print mbedtls_mpi: 759 bits
53 …fbb2f958b4424":"MyFile":999:"VALUE":"MyFile(0999)\: value of 'VALUE' (759 bits) is\:\nMyFile(0999)…
55 Debug print mbedtls_mpi: 764 bits #1
56 …fbb2f958b4424":"MyFile":999:"VALUE":"MyFile(0999)\: value of 'VALUE' (764 bits) is\:\nMyFile(0999)…
[all …]
Dtest_suite_psa_crypto_se_driver_hal.function126 /* If not listed above, assume a multiple of 8 bits. */
194 size_t *bits)
202 *bits = PSA_BYTES_TO_BITS(data_length);
251 size_t bits;
256 /* A type with at least ARRAY_LENGTH(ram_slots) bits, containing a
289 ram_slots[slot_number].bits = psa_get_key_bits(attributes);
330 size_t *bits)
343 *bits = PSA_BYTES_TO_BITS(data_length);
345 *bits = ecc_curve_bits(PSA_KEY_TYPE_ECC_GET_FAMILY(type), data_length);
346 if (*bits == 0) {
[all …]
Dtest_suite_rsa.data187 RSA PKCS1 Sign #1 (SHA512, 1536 bits RSA)
195 RSA PKCS1 Sign #2 (SHA256, 2048 bits RSA)
207 RSA PKCS1 Sign #3 (SHA224, 2048 bits RSA)
215 RSA PKCS1 Sign #4 (SHA384, 2048 bits RSA)
223 RSA PKCS1 Sign #7 (MD5, 2048 bits RSA)
231 RSA PKCS1 Sign #8 (RAW, 2048 bits RSA)
251 RSA PKCS1 Sign #10 (RIPEMD160, 2048 bits RSA)
255 RSA PKCS1 Verify #10 (RIPEMD160, 2048 bits RSA)
324 RSA Check Public key #4 (N exactly 128 bits)
327 RSA Check Public key #5 (N smaller than 128 bits)
[all …]
Dtest_suite_psa_crypto_hash.data193 PSA hash finish: SHA3-224 Test Vector NIST 448 bits: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnl…
197 PSA hash finish: SHA3-256 Test Vector NIST 448 bits: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnl…
201 PSA hash finish: SHA3-384 Test Vector NIST 448 bits: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnl…
205 PSA hash finish: SHA3-512 Test Vector NIST 448 bits: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnl…
209 PSA hash finish: SHA3-224 Test Vector NIST 896 bits: "abcdefghbcdefghicdefghijdefghijkefghijklfghij…
213 PSA hash finish: SHA3-256 Test Vector NIST 896 bits: "abcdefghbcdefghicdefghijdefghijkefghijklfghij…
217 PSA hash finish: SHA3-384 Test Vector NIST 896 bits: "abcdefghbcdefghicdefghijdefghijkefghijklfghij…
221 PSA hash finish: SHA3-512 Test Vector NIST 896 bits: "abcdefghbcdefghicdefghijdefghijkefghijklfghij…
581 PSA hash multi part: SHA3-224 Test Vector NIST 448 bits: "abcdbcdecdefdefgefghfghighijhijkijkljklmk…
585 PSA hash multi part: SHA3-256 Test Vector NIST 448 bits: "abcdbcdecdefdefgefghfghighijhijkijkljklmk…
[all …]
Dtest_suite_bignum_core.generated.data21445 Core shift(L) #1 0 (0 bits in 1 limbs) << 0
21449 Core shift(L) #2 0 (0 bits in 1 limbs) << 0
21453 Core shift(L) #3 0 (0 bits in 1 limbs) << 1
21457 Core shift(L) #4 0 (0 bits in 1 limbs) << 1
21461 Core shift(L) #5 0 (0 bits in 1 limbs) << 2
21465 Core shift(L) #6 0 (0 bits in 1 limbs) << 2
21469 Core shift(L) #7 0 (0 bits in 1 limbs) << 3
21473 Core shift(L) #8 0 (0 bits in 1 limbs) << 3
21477 Core shift(L) #9 0 (0 bits in 1 limbs) << 4
21481 Core shift(L) #10 0 (0 bits in 1 limbs) << 4
[all …]
Dtest_suite_psa_crypto_generate_key.function23 size_t bits = bits_arg;
28 psa_set_key_bits(&attributes, bits);
40 TEST_EQUAL(psa_get_key_bits(&attributes), bits);
Dtest_suite_asn1write.function389 void test_asn1_write_bitstrings(data_t *bitstring, int bits,
395 const unsigned char *buf, size_t bits) =
402 /* The API expects `bitstring->x` to contain `bits` bits. */
403 size_t byte_length = (bits + 7) / 8;
410 if (bits % 8 != 0) {
411 masked_bitstring[byte_length - 1] &= ~(0xff >> (bits % 8));
414 size_t value_bits = bits;
416 /* In a named bit string, all trailing 0 bits are removed. */
434 ret = (*func)(&data.p, data.start, bitstring->x, bits);
Dtest_suite_x509parse.data3 …14\:44\:06\nsigned using \: RSA with SHA1\nRSA key size \: 2048 bits\nbasic constraints …
7 …14\:44\:06\nsigned using \: RSA with SHA1\nRSA key size \: 2048 bits\nbasic constraints …
11 …14\:44\:06\nsigned using \: RSA with SHA1\nRSA key size \: 2048 bits\nbasic constraints …
15 …14\:44\:06\nsigned using \: RSA with SHA1\nRSA key size \: 2048 bits\nbasic constraints …
19 …14\:44\:00\nsigned using \: RSA with SHA1\nRSA key size \: 2048 bits\nbasic constraints …
23 …14\:44\:00\nsigned using \: RSA with SHA1\nRSA key size \: 2048 bits\nbasic constraints …
27 … 12\:12\:12\nsigned using \: RSA with MD5\nRSA key size \: 2048 bits\nbasic constraints …
31 …14\:44\:06\nsigned using \: RSA with SHA1\nRSA key size \: 2048 bits\nbasic constraints …
35 …:44\:06\nsigned using \: RSA with SHA-224\nRSA key size \: 2048 bits\nbasic constraints …
39 …:44\:06\nsigned using \: RSA with SHA-256\nRSA key size \: 2048 bits\nbasic constraints …
[all …]
Dtest_suite_psa_crypto_se_driver_hal_mocks.function31 size_t bits;
150 size_t *bits)
155 *bits = mock_import_data.bits;
322 int bits,
336 mock_import_data.bits = bits;
/mbedtls-latest/tests/src/
Dpsa_exercise_key.c49 size_t bits; in check_key_attributes_sanity() local
60 bits = psa_get_key_bits(&attributes); in check_key_attributes_sanity()
94 TEST_ASSERT(bits != 0); in check_key_attributes_sanity()
95 TEST_ASSERT(bits <= PSA_MAX_KEY_BITS); in check_key_attributes_sanity()
97 TEST_ASSERT(bits % 8 == 0); in check_key_attributes_sanity()
102 TEST_ASSERT(bits <= PSA_VENDOR_ECC_MAX_CURVE_BITS); in check_key_attributes_sanity()
104 TEST_ASSERT(bits <= PSA_VENDOR_RSA_MAX_KEY_BITS); in check_key_attributes_sanity()
844 psa_key_type_t type, size_t bits, in mbedtls_test_psa_exported_key_sanity_check() argument
847 TEST_ASSERT(exported_length <= PSA_EXPORT_KEY_OUTPUT_SIZE(type, bits)); in mbedtls_test_psa_exported_key_sanity_check()
850 TEST_EQUAL(exported_length, PSA_BITS_TO_BYTES(bits)); in mbedtls_test_psa_exported_key_sanity_check()
[all …]
/mbedtls-latest/tests/src/drivers/
Dtest_driver_key_management.c272 size_t *bits) in mbedtls_test_transparent_import_key() argument
291 key_buffer_length, bits); in mbedtls_test_transparent_import_key()
298 key_buffer_length, bits); in mbedtls_test_transparent_import_key()
308 key_buffer_length, bits); in mbedtls_test_transparent_import_key()
315 key_buffer_length, bits); in mbedtls_test_transparent_import_key()
325 key_buffer_length, bits); in mbedtls_test_transparent_import_key()
332 key_buffer_length, bits); in mbedtls_test_transparent_import_key()
340 (void) bits; in mbedtls_test_transparent_import_key()
354 size_t *bits) in mbedtls_test_opaque_import_key() argument
375 *bits = PSA_BYTES_TO_BITS(data_length); in mbedtls_test_opaque_import_key()
[all …]
/mbedtls-latest/3rdparty/p256-m/
Dp256-m_driver_entrypoints.c67 size_t *bits) in p256_transparent_import_key() argument
70 if (*bits != 0 && *bits != CURVE_BITS) { in p256_transparent_import_key()
78 return *bits == 0 ? PSA_ERROR_NOT_SUPPORTED : PSA_ERROR_INVALID_ARGUMENT; in p256_transparent_import_key()
86 return *bits == 0 ? PSA_ERROR_NOT_SUPPORTED : PSA_ERROR_INVALID_ARGUMENT; in p256_transparent_import_key()
94 *bits = CURVE_BITS; in p256_transparent_import_key()
114 size_t bits = psa_get_key_bits(attributes); in p256_transparent_export_public_key() local
116 if (bits != CURVE_BITS || type != PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)) { in p256_transparent_export_public_key()
/mbedtls-latest/include/psa/
Dcrypto_struct.h301 psa_key_bits_t MBEDTLS_PRIVATE(bits);
432 size_t bits) in psa_set_key_bits() argument
434 if (bits > PSA_MAX_KEY_BITS) { in psa_set_key_bits()
435 attributes->MBEDTLS_PRIVATE(bits) = PSA_KEY_BITS_TOO_LARGE; in psa_set_key_bits()
437 attributes->MBEDTLS_PRIVATE(bits) = (psa_key_bits_t) bits; in psa_set_key_bits()
444 return attributes->MBEDTLS_PRIVATE(bits); in psa_get_key_bits()
/mbedtls-latest/include/mbedtls/
Dpsa_util.h88 size_t *bits);
103 size_t bits);
165 int mbedtls_ecdsa_raw_to_der(size_t bits, const unsigned char *raw, size_t raw_len,
181 int mbedtls_ecdsa_der_to_raw(size_t bits, const unsigned char *der, size_t der_len,
Decdsa.h44 #define MBEDTLS_ECDSA_MAX_SIG_LEN(bits) \ argument
45 (/*T,L of SEQUENCE*/ ((bits) >= 61 * 8 ? 3 : 2) + \
46 /*T,L of r,s*/ 2 * (((bits) >= 127 * 8 ? 3 : 2) + \
47 /*V of r,s*/ ((bits) + 8) / 8))

1234