mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-24 12:25:40 +00:00
Private EC key format: update key representation size macro
This commit is contained in:
parent
2257649ce4
commit
5eb1521957
|
@ -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().
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue