Lines Matching refs:bits
49 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()
877 if (!mbedtls_test_asn1_skip_integer(&p, end, bits, bits, 1)) { in mbedtls_test_psa_exported_key_sanity_check()
880 if (!mbedtls_test_asn1_skip_integer(&p, end, 2, bits, 1)) { in mbedtls_test_psa_exported_key_sanity_check()
884 if (!mbedtls_test_asn1_skip_integer(&p, end, bits / 2, bits, 1)) { in mbedtls_test_psa_exported_key_sanity_check()
888 if (!mbedtls_test_asn1_skip_integer(&p, end, bits / 2, bits / 2 + 1, 1)) { in mbedtls_test_psa_exported_key_sanity_check()
891 if (!mbedtls_test_asn1_skip_integer(&p, end, bits / 2, bits / 2 + 1, 1)) { in mbedtls_test_psa_exported_key_sanity_check()
894 if (!mbedtls_test_asn1_skip_integer(&p, end, 1, bits / 2 + 1, 0)) { in mbedtls_test_psa_exported_key_sanity_check()
897 if (!mbedtls_test_asn1_skip_integer(&p, end, 1, bits / 2 + 1, 0)) { in mbedtls_test_psa_exported_key_sanity_check()
900 if (!mbedtls_test_asn1_skip_integer(&p, end, 1, bits / 2 + 1, 0)) { in mbedtls_test_psa_exported_key_sanity_check()
911 TEST_EQUAL(exported_length, PSA_BITS_TO_BYTES(bits)); in mbedtls_test_psa_exported_key_sanity_check()
930 if (!mbedtls_test_asn1_skip_integer(&p, end, bits, bits, 1)) { in mbedtls_test_psa_exported_key_sanity_check()
933 if (!mbedtls_test_asn1_skip_integer(&p, end, 2, bits, 1)) { in mbedtls_test_psa_exported_key_sanity_check()
940 PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(type, bits)); in mbedtls_test_psa_exported_key_sanity_check()
949 PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(type, bits)); in mbedtls_test_psa_exported_key_sanity_check()
956 TEST_EQUAL(PSA_BITS_TO_BYTES(bits), exported_length); in mbedtls_test_psa_exported_key_sanity_check()
960 TEST_EQUAL(PSA_BITS_TO_BYTES(bits + 1), exported_length); in mbedtls_test_psa_exported_key_sanity_check()
968 TEST_EQUAL(1 + 2 * PSA_BITS_TO_BYTES(bits), exported_length); in mbedtls_test_psa_exported_key_sanity_check()
974 PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(type, bits)); in mbedtls_test_psa_exported_key_sanity_check()
986 for (i = 0; i < bits / 8; i++) { in mbedtls_test_psa_exported_key_sanity_check()