From 5eb1521957dba7118640fce1dfe9d9eb4d4361d8 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 31 Oct 2018 13:24:35 +0100 Subject: [PATCH] Private EC key format: update key representation size macro --- include/psa/crypto_sizes.h | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/include/psa/crypto_sizes.h b/include/psa/crypto_sizes.h index b5ff2aac3..edddca47a 100644 --- a/include/psa/crypto_sizes.h +++ b/include/psa/crypto_sizes.h @@ -437,23 +437,10 @@ /* Maximum size of the export encoding of an ECC key pair. * - * ECPrivateKey ::= SEQUENCE { - * version INTEGER, -- must be 1 - * privateKey OCTET STRING, - * -- `ceiling(log2(n)/8)`-byte string, big endian, - * -- where n is the order of the curve. - * parameters [0] IMPLICIT ECParameters {{ NamedCurve }}, - * publicKey [1] IMPLICIT BIT STRING - * } - * - * - 4 bytes of SEQUENCE overhead; - * - 1 * point size in privateKey - * - 1 + 1 + 12 bytes of namedCurve OID; - * - 4 bytes of BIT STRING overhead; - * - public key as for #PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE. + * An ECC key pair is represented by the secret value. */ #define PSA_KEY_EXPORT_ECC_KEYPAIR_MAX_SIZE(key_bits) \ - (3 * PSA_BITS_TO_BYTES(key_bits) + 56) + (PSA_BITS_TO_BYTES(key_bits)) /** Safe output buffer size for psa_export_key() or psa_export_public_key(). *