Merge pull request #7164 from oberon-microsystems/fix-test-exported-length-edwards

Fix expected export length for Edwards curves in test suite.
This commit is contained in:
Gilles Peskine 2023-03-07 19:53:48 +01:00 committed by GitHub
commit 30fc999f43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -778,6 +778,10 @@ int mbedtls_test_psa_exported_key_sanity_check(
/* The representation of an ECC Montgomery public key is
* the raw compressed point */
TEST_EQUAL(PSA_BITS_TO_BYTES(bits), exported_length);
} else if (PSA_KEY_TYPE_ECC_GET_FAMILY(type) == PSA_ECC_FAMILY_TWISTED_EDWARDS) {
/* The representation of an ECC Edwards public key is
* the raw compressed point */
TEST_EQUAL(PSA_BITS_TO_BYTES(bits + 1), exported_length);
} else {
/* The representation of an ECC Weierstrass public key is:
* - The byte 0x04;