Key size definitions for the PSA Crypto API. More...
Key size definitions for the PSA Crypto API.
Definition in file sizes.h.
Go to the source code of this file.
#define | CONFIG_PSA_MAX_KEY_SIZE 0 |
Maximum key size in bytes, determined by the build system. More... | |
#define | PSA_KEY_EXPORT_ECC_KEY_MAX_SIZE(key_type, key_bits) |
Maximum size of the export encoding of an ECC keypair. More... | |
#define | PSA_EXPORT_KEY_OUTPUT_SIZE(key_type, key_bits) |
Sufficient output buffer size for psa_export_key(). More... | |
#define | PSA_ECC_KEY_SIZE_IS_VALID(type, bits) |
Check whether the key size is a valid ECC size for key type. More... | |
#define | PSA_MAX_PRIV_KEY_SIZE (PSA_BYTES_TO_BITS(CONFIG_PSA_MAX_KEY_SIZE)) |
The maximum size of an asymmetric private key. | |
#define | PSA_EXPORT_KEY_PAIR_MAX_SIZE 0 |
Sufficient buffer size for exporting any asymmetric key pair. More... | |
#define | PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(key_type, key_bits) |
Maximum size of the export encoding of an ECC public key. More... | |
#define | PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(key_type, key_bits) |
Sufficient output buffer size for psa_export_public_key(). More... | |
#define | PSA_EXPORT_PUBLIC_KEY_MAX_SIZE 0 |
Sufficient buffer size for exporting any asymmetric public key. More... | |
#define | PSA_MAX_PRIV_KEY_BUFFER_SIZE (PSA_BITS_TO_BYTES(PSA_MAX_PRIV_KEY_SIZE)) |
The maximum size of an asymmetric private key buffer. More... | |
#define | PSA_MAX_ASYMMETRIC_KEYPAIR_SIZE |
The maximum size of an asymmetric private key pair. More... | |
#define | PSA_MAX_KEY_DATA_SIZE (CONFIG_PSA_MAX_KEY_SIZE) |
The maximum size of the used key data. | |
#define | PSA_MAX_UNSTRUCTURED_KEY_SIZE (CONFIG_PSA_MAX_KEY_SIZE) |
The maximum size of an unstructured key. | |
#define CONFIG_PSA_MAX_KEY_SIZE 0 |
#define PSA_ECC_KEY_SIZE_IS_VALID | ( | type, | |
bits | |||
) |
Check whether the key size is a valid ECC size for key type.
type | key type of of type psa_key_type_t |
bits | Key size of type psa_key_bits_t |
#define PSA_EXPORT_KEY_OUTPUT_SIZE | ( | key_type, | |
key_bits | |||
) |
Sufficient output buffer size for psa_export_key().
The following code illustrates how to allocate enough memory to export a key by querying the key type and size at runtime.
See also PSA_EXPORT_KEY_PAIR_MAX_SIZE and PSA_EXPORT_PUBLIC_KEY_MAX_SIZE.
key_type | A supported key type. |
key_bits | The size of the key in bits. |
#define PSA_EXPORT_KEY_PAIR_MAX_SIZE 0 |
Sufficient buffer size for exporting any asymmetric key pair.
This value must be a sufficient buffer size when calling psa_export_key() to export any asymmetric key pair that is supported by the implementation, regardless of the exact key type and key size.
See also PSA_EXPORT_KEY_OUTPUT_SIZE().
#define PSA_EXPORT_PUBLIC_KEY_MAX_SIZE 0 |
Sufficient buffer size for exporting any asymmetric public key.
This macro expands to a compile-time constant integer. This value is a sufficient buffer size when calling psa_export_key() or psa_export_public_key() to export any asymmetric public key, regardless of the exact key type and key size.
See also PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(key_type
, key_bits
).
#define PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE | ( | key_type, | |
key_bits | |||
) |
Sufficient output buffer size for psa_export_public_key().
This macro returns a compile-time constant if its arguments are compile-time constants.
The following code illustrates how to allocate enough memory to export a public key by querying the key type and size at runtime.
key_type | A public key or key pair key type. |
key_bits | The size of the key in bits. |
key_type
), key_bits
). #define PSA_KEY_EXPORT_ECC_KEY_MAX_SIZE | ( | key_type, | |
key_bits | |||
) |
Maximum size of the export encoding of an ECC keypair.
The representation of an ECC keypair follows https://arm-software.github.io/psa-api/crypto/1.1/api/keys/management.html#key-formats and is dependent on the family:
ceiling(m/8)
-byte string, big-endian where m is the bit size associated with the curve. #define PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE | ( | key_type, | |
key_bits | |||
) |
Maximum size of the export encoding of an ECC public key.
The representation of an ECC public key is dependent on the family:
x_P
as a ceiling(m/8)
-byte string, big-endian;y_P
as a ceiling(m/8)
-byte string, big-endian;#define PSA_MAX_ASYMMETRIC_KEYPAIR_SIZE |
The maximum size of an asymmetric private key pair.
#define PSA_MAX_PRIV_KEY_BUFFER_SIZE (PSA_BITS_TO_BYTES(PSA_MAX_PRIV_KEY_SIZE)) |