Data size definitions.
Macros | |
| #define | IFX_SE_HASH_LENGTH(alg) |
| The size of the output of ifx_se_hash_finish(), in bytes. More... | |
| #define | IFX_SE_HASH_BLOCK_LENGTH(alg) |
| The input block size of a hash algorithm, in bytes. More... | |
| #define | IFX_SE_HASH_MAX_SIZE 32u |
| Maximum size of a hash. More... | |
| #define | IFX_SE_MAC_MAX_SIZE IFX_SE_HASH_MAX_SIZE |
| Maximum size of a MAC. More... | |
| #define | IFX_SE_AEAD_TAG_LENGTH(key_type, key_bits, alg) |
| The length of a tag for an AEAD algorithm, in bytes. More... | |
| #define | IFX_SE_AEAD_TAG_MAX_SIZE 16u |
| The maximum tag size for all supported AEAD algorithms, in bytes. More... | |
| #define | IFX_SE_VENDOR_RSA_MAX_KEY_BITS 4096u |
| The maximum size of an RSA key on this implementation, in bits. More... | |
| #define | IFX_SE_VENDOR_ECC_MAX_CURVE_BITS 384u |
| The maximum size of an ECC key on this implementation, in bits. More... | |
| #define | IFX_SE_TLS12_PSK_TO_MS_PSK_MAX_SIZE 128u |
This macro returns the maximum supported length of the PSK for the TLS-1.2 PSK-to-MS key derivation (IFX_SE_ALG_TLS12_PSK_TO_MS(hash_alg)). More... | |
| #define | IFX_SE_BLOCK_CIPHER_BLOCK_MAX_SIZE 16u |
| The maximum size of a block cipher. | |
| #define | IFX_SE_MAC_LENGTH(key_type, key_bits, alg) |
| The size of the output of ifx_se_mac_sign_finish(), in bytes. More... | |
| #define | IFX_SE_AEAD_ENCRYPT_OUTPUT_SIZE(key_type, alg, plaintext_length) |
| The maximum size of the output of ifx_se_aead_encrypt(), in bytes. More... | |
| #define | IFX_SE_AEAD_ENCRYPT_OUTPUT_MAX_SIZE(plaintext_length) ((plaintext_length) + IFX_SE_AEAD_TAG_MAX_SIZE) |
| A sufficient output buffer size for ifx_se_aead_encrypt(), for any of the supported key types and AEAD algorithms. More... | |
| #define | IFX_SE_AEAD_DECRYPT_OUTPUT_SIZE(key_type, alg, ciphertext_length) |
| The maximum size of the output of ifx_se_aead_decrypt(), in bytes. More... | |
| #define | IFX_SE_AEAD_DECRYPT_OUTPUT_MAX_SIZE(ciphertext_length) (ciphertext_length) |
| A sufficient output buffer size for ifx_se_aead_decrypt(), for any of the supported key types and AEAD algorithms. More... | |
| #define | IFX_SE_AEAD_NONCE_LENGTH(key_type, alg) |
| The default nonce size for an AEAD algorithm, in bytes. More... | |
| #define | IFX_SE_AEAD_NONCE_MAX_SIZE 13u |
| The maximum default nonce size among all supported pairs of key types and AEAD algorithms, in bytes. More... | |
| #define | IFX_SE_AEAD_UPDATE_OUTPUT_SIZE(key_type, alg, input_length) |
| A sufficient output buffer size for ifx_se_aead_update(). More... | |
| #define | IFX_SE_AEAD_UPDATE_OUTPUT_MAX_SIZE(input_length) (IFX_SE_ROUND_UP_TO_MULTIPLE(IFX_SE_BLOCK_CIPHER_BLOCK_MAX_SIZE, (input_length))) |
| A sufficient output buffer size for ifx_se_aead_update(), for any of the supported key types and AEAD algorithms. More... | |
| #define | IFX_SE_AEAD_FINISH_OUTPUT_SIZE(key_type, alg) |
| A sufficient ciphertext buffer size for ifx_se_aead_finish(). More... | |
| #define | IFX_SE_AEAD_FINISH_OUTPUT_MAX_SIZE (IFX_SE_BLOCK_CIPHER_BLOCK_MAX_SIZE) |
| A sufficient ciphertext buffer size for ifx_se_aead_finish(), for any of the supported key types and AEAD algorithms. More... | |
| #define | IFX_SE_AEAD_VERIFY_OUTPUT_SIZE(key_type, alg) |
| A sufficient plaintext buffer size for ifx_se_aead_verify(). More... | |
| #define | IFX_SE_AEAD_VERIFY_OUTPUT_MAX_SIZE (IFX_SE_BLOCK_CIPHER_BLOCK_MAX_SIZE) |
| A sufficient plaintext buffer size for ifx_se_aead_verify(), for any of the supported key types and AEAD algorithms. More... | |
| #define | IFX_SE_ECDSA_SIGNATURE_SIZE(curve_bits) (IFX_SE_BITS_TO_BYTES(curve_bits) * 2u) |
| ECDSA signature size for a given curve bit size. More... | |
| #define | IFX_SE_SIGN_OUTPUT_SIZE(key_type, key_bits, alg) |
| Sufficient signature buffer size for ifx_se_sign_hash(). More... | |
| #define | IFX_SE_SIGNATURE_MAX_SIZE 1 |
| Maximum size of an asymmetric signature. More... | |
| #define | IFX_SE_SIGNATURE_MAX_SIZE IFX_SE_BITS_TO_BYTES(IFX_SE_VENDOR_RSA_MAX_KEY_BITS) |
| Maximum size of an asymmetric signature. More... | |
| #define | IFX_SE_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(key_bits) (2u * IFX_SE_BITS_TO_BYTES(key_bits) + 1u) |
| Maximum size of the export encoding of an ECC public key. More... | |
| #define | IFX_SE_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(key_bits) (IFX_SE_BITS_TO_BYTES(key_bits)) |
| Maximum size of the export encoding of an ECC key pair. More... | |
| #define | IFX_SE_EXPORT_KEY_OUTPUT_SIZE(key_type, key_bits) |
| Sufficient output buffer size for ifx_se_export_key() or ifx_se_export_public_key(). More... | |
| #define | IFX_SE_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(key_type, key_bits) |
| Sufficient output buffer size for ifx_se_export_public_key(). More... | |
| #define | IFX_SE_EXPORT_KEY_PAIR_MAX_SIZE IFX_SE_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(IFX_SE_VENDOR_ECC_MAX_CURVE_BITS) |
| Sufficient buffer size for exporting any asymmetric key pair. More... | |
| #define | IFX_SE_EXPORT_PUBLIC_KEY_MAX_SIZE IFX_SE_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(IFX_SE_VENDOR_ECC_MAX_CURVE_BITS) |
| Sufficient buffer size for exporting any asymmetric public key. More... | |
| #define | IFX_SE_RAW_KEY_AGREEMENT_OUTPUT_SIZE(key_type, key_bits) |
| Sufficient output buffer size for ifx_se_raw_key_agreement(). More... | |
| #define | IFX_SE_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE 1 |
| Maximum size of the output from ifx_se_raw_key_agreement(). More... | |
| #define | IFX_SE_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE IFX_SE_BITS_TO_BYTES(IFX_SE_VENDOR_ECC_MAX_CURVE_BITS) |
| Maximum size of the output from ifx_se_raw_key_agreement(). More... | |
| #define | IFX_SE_CIPHER_IV_LENGTH(key_type, alg) |
| The default IV size for a cipher algorithm, in bytes. More... | |
| #define | IFX_SE_CIPHER_IV_MAX_SIZE 16u |
| The maximum IV size for all supported cipher algorithms, in bytes. More... | |
| #define | IFX_SE_CIPHER_ENCRYPT_OUTPUT_SIZE(key_type, alg, input_length) |
| The maximum size of the output of ifx_se_cipher_encrypt(), in bytes. More... | |
| #define | IFX_SE_CIPHER_ENCRYPT_OUTPUT_MAX_SIZE(input_length) |
| A sufficient output buffer size for ifx_se_cipher_encrypt(), for any of the supported key types and cipher algorithms. More... | |
| #define | IFX_SE_CIPHER_DECRYPT_OUTPUT_SIZE(key_type, alg, input_length) |
| The maximum size of the output of ifx_se_cipher_decrypt(), in bytes. More... | |
| #define | IFX_SE_CIPHER_DECRYPT_OUTPUT_MAX_SIZE(input_length) (input_length) |
| A sufficient output buffer size for ifx_se_cipher_decrypt(), for any of the supported key types and cipher algorithms. More... | |
| #define | IFX_SE_CIPHER_UPDATE_OUTPUT_SIZE(key_type, alg, input_length) |
| A sufficient output buffer size for ifx_se_cipher_update(). More... | |
| #define | IFX_SE_CIPHER_UPDATE_OUTPUT_MAX_SIZE(input_length) (IFX_SE_ROUND_UP_TO_MULTIPLE(IFX_SE_BLOCK_CIPHER_BLOCK_MAX_SIZE, input_length)) |
| A sufficient output buffer size for ifx_se_cipher_update(), for any of the supported key types and cipher algorithms. More... | |
| #define | IFX_SE_CIPHER_FINISH_OUTPUT_SIZE(key_type, alg) |
| A sufficient ciphertext buffer size for ifx_se_cipher_finish(). More... | |
| #define | IFX_SE_CIPHER_FINISH_OUTPUT_MAX_SIZE (IFX_SE_BLOCK_CIPHER_BLOCK_MAX_SIZE) |
| A sufficient ciphertext buffer size for ifx_se_cipher_finish(), for any of the supported key types and cipher algorithms. More... | |
| #define IFX_SE_HASH_LENGTH | ( | alg | ) |
The size of the output of ifx_se_hash_finish(), in bytes.
This is also the hash size that ifx_se_hash_verify() expects.
| alg | A hash algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_HASH(alg) is true), or an HMAC algorithm (IFX_SE_ALG_HMAC(hash_alg) where hash_alg is a hash algorithm). |
| #define IFX_SE_HASH_BLOCK_LENGTH | ( | alg | ) |
The input block size of a hash algorithm, in bytes.
Hash algorithms process their input data in blocks. Hash operations will retain any partial blocks until they have enough input to fill the block or until the operation is finished. This affects the output from ifx_se_hash_suspend().
| alg | A hash algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_HASH(alg) is true). |
| #define IFX_SE_HASH_MAX_SIZE 32u |
Maximum size of a hash.
This macro expands to a compile-time constant integer. This value is the maximum size of a hash in bytes.
| #define IFX_SE_MAC_MAX_SIZE IFX_SE_HASH_MAX_SIZE |
Maximum size of a MAC.
This macro expands to a compile-time constant integer. This value is the maximum size of a MAC in bytes.
| #define IFX_SE_AEAD_TAG_LENGTH | ( | key_type, | |
| key_bits, | |||
| alg | |||
| ) |
The length of a tag for an AEAD algorithm, in bytes.
This macro can be used to allocate a buffer of sufficient size to store the tag output from ifx_se_aead_finish().
See also IFX_SE_AEAD_TAG_MAX_SIZE.
| key_type | The type of the AEAD key. |
| key_bits | The size of the AEAD key in bits. |
| alg | An AEAD algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_AEAD(alg) is true). |
| #define IFX_SE_AEAD_TAG_MAX_SIZE 16u |
The maximum tag size for all supported AEAD algorithms, in bytes.
See also IFX_SE_AEAD_TAG_LENGTH(key_type, key_bits, alg).
| #define IFX_SE_VENDOR_RSA_MAX_KEY_BITS 4096u |
The maximum size of an RSA key on this implementation, in bits.
This is a vendor-specific macro.
Mbed TLS does not set a hard limit on the size of RSA keys: any key whose parameters fit in a bignum is accepted. However large keys can induce a large memory usage and long computation times. Unlike other auxiliary macros in this file and in crypto.h, which reflect how the library is configured, this macro defines how the library is configured. This implementation refuses to import or generate an RSA key whose size is larger than the value defined here.
Note that an implementation may set different size limits for different operations, and does not need to accept all key sizes up to the limit.
| #define IFX_SE_VENDOR_ECC_MAX_CURVE_BITS 384u |
The maximum size of an ECC key on this implementation, in bits.
This is a vendor-specific macro.
| #define IFX_SE_TLS12_PSK_TO_MS_PSK_MAX_SIZE 128u |
This macro returns the maximum supported length of the PSK for the TLS-1.2 PSK-to-MS key derivation (IFX_SE_ALG_TLS12_PSK_TO_MS(hash_alg)).
The maximum supported length does not depend on the chosen hash algorithm.
Quoting RFC 4279, Sect 5.3: TLS implementations supporting these ciphersuites MUST support arbitrary PSK identities up to 128 octets in length, and arbitrary PSKs up to 64 octets in length. Supporting longer identities and keys is RECOMMENDED.
Therefore, no implementation should define a value smaller than 64 for IFX_SE_TLS12_PSK_TO_MS_PSK_MAX_SIZE.
| #define IFX_SE_MAC_LENGTH | ( | key_type, | |
| key_bits, | |||
| alg | |||
| ) |
The size of the output of ifx_se_mac_sign_finish(), in bytes.
This is also the MAC size that ifx_se_mac_verify_finish() expects.
| key_type | The type of the MAC key. |
| key_bits | The size of the MAC key in bits. |
| alg | A MAC algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_MAC(alg) is true). |
| #define IFX_SE_AEAD_ENCRYPT_OUTPUT_SIZE | ( | key_type, | |
| alg, | |||
| plaintext_length | |||
| ) |
The maximum size of the output of ifx_se_aead_encrypt(), in bytes.
If the size of the ciphertext buffer is at least this large, it is guaranteed that ifx_se_aead_encrypt() will not fail due to an insufficient buffer size. Depending on the algorithm, the actual size of the ciphertext may be smaller.
See also IFX_SE_AEAD_ENCRYPT_OUTPUT_MAX_SIZE(plaintext_length).
| key_type | A symmetric key type that is compatible with algorithm alg. |
| alg | An AEAD algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_AEAD(alg) is true). |
| plaintext_length | Size of the plaintext in bytes. |
| #define IFX_SE_AEAD_ENCRYPT_OUTPUT_MAX_SIZE | ( | plaintext_length | ) | ((plaintext_length) + IFX_SE_AEAD_TAG_MAX_SIZE) |
A sufficient output buffer size for ifx_se_aead_encrypt(), for any of the supported key types and AEAD algorithms.
If the size of the ciphertext buffer is at least this large, it is guaranteed that ifx_se_aead_encrypt() will not fail due to an insufficient buffer size.
See also IFX_SE_AEAD_ENCRYPT_OUTPUT_SIZE(key_type, alg, plaintext_length).
| plaintext_length | Size of the plaintext in bytes. |
| #define IFX_SE_AEAD_DECRYPT_OUTPUT_SIZE | ( | key_type, | |
| alg, | |||
| ciphertext_length | |||
| ) |
The maximum size of the output of ifx_se_aead_decrypt(), in bytes.
If the size of the plaintext buffer is at least this large, it is guaranteed that ifx_se_aead_decrypt() will not fail due to an insufficient buffer size. Depending on the algorithm, the actual size of the plaintext may be smaller.
See also IFX_SE_AEAD_DECRYPT_OUTPUT_MAX_SIZE(ciphertext_length).
| key_type | A symmetric key type that is compatible with algorithm alg. |
| alg | An AEAD algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_AEAD(alg) is true). |
| ciphertext_length | Size of the plaintext in bytes. |
| #define IFX_SE_AEAD_DECRYPT_OUTPUT_MAX_SIZE | ( | ciphertext_length | ) | (ciphertext_length) |
A sufficient output buffer size for ifx_se_aead_decrypt(), for any of the supported key types and AEAD algorithms.
If the size of the plaintext buffer is at least this large, it is guaranteed that ifx_se_aead_decrypt() will not fail due to an insufficient buffer size.
See also IFX_SE_AEAD_DECRYPT_OUTPUT_SIZE(key_type, alg, ciphertext_length).
| ciphertext_length | Size of the ciphertext in bytes. |
| #define IFX_SE_AEAD_NONCE_LENGTH | ( | key_type, | |
| alg | |||
| ) |
The default nonce size for an AEAD algorithm, in bytes.
This macro can be used to allocate a buffer of sufficient size to store the nonce output from ifx_se_aead_generate_nonce().
See also IFX_SE_AEAD_NONCE_MAX_SIZE.
| key_type | A symmetric key type that is compatible with algorithm alg. |
| alg | An AEAD algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_AEAD(alg) is true). |
| #define IFX_SE_AEAD_NONCE_MAX_SIZE 13u |
The maximum default nonce size among all supported pairs of key types and AEAD algorithms, in bytes.
This is equal to or greater than any value that IFX_SE_AEAD_NONCE_LENGTH() may return.
| #define IFX_SE_AEAD_UPDATE_OUTPUT_SIZE | ( | key_type, | |
| alg, | |||
| input_length | |||
| ) |
A sufficient output buffer size for ifx_se_aead_update().
If the size of the output buffer is at least this large, it is guaranteed that ifx_se_aead_update() will not fail due to an insufficient buffer size. The actual size of the output may be smaller in any given call.
See also IFX_SE_AEAD_UPDATE_OUTPUT_MAX_SIZE(input_length).
| key_type | A symmetric key type that is compatible with algorithm alg. |
| alg | An AEAD algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_AEAD(alg) is true). |
| input_length | Size of the input in bytes. |
| #define IFX_SE_AEAD_UPDATE_OUTPUT_MAX_SIZE | ( | input_length | ) | (IFX_SE_ROUND_UP_TO_MULTIPLE(IFX_SE_BLOCK_CIPHER_BLOCK_MAX_SIZE, (input_length))) |
A sufficient output buffer size for ifx_se_aead_update(), for any of the supported key types and AEAD algorithms.
If the size of the output buffer is at least this large, it is guaranteed that ifx_se_aead_update() will not fail due to an insufficient buffer size.
See also IFX_SE_AEAD_UPDATE_OUTPUT_SIZE(key_type, alg, input_length).
| input_length | Size of the input in bytes. |
| #define IFX_SE_AEAD_FINISH_OUTPUT_SIZE | ( | key_type, | |
| alg | |||
| ) |
A sufficient ciphertext buffer size for ifx_se_aead_finish().
If the size of the ciphertext buffer is at least this large, it is guaranteed that ifx_se_aead_finish() will not fail due to an insufficient ciphertext buffer size. The actual size of the output may be smaller in any given call.
See also IFX_SE_AEAD_FINISH_OUTPUT_MAX_SIZE.
| key_type | A symmetric key type that is compatible with algorithm alg. |
| alg | An AEAD algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_AEAD(alg) is true). |
| #define IFX_SE_AEAD_FINISH_OUTPUT_MAX_SIZE (IFX_SE_BLOCK_CIPHER_BLOCK_MAX_SIZE) |
A sufficient ciphertext buffer size for ifx_se_aead_finish(), for any of the supported key types and AEAD algorithms.
See also IFX_SE_AEAD_FINISH_OUTPUT_SIZE(key_type, alg).
| #define IFX_SE_AEAD_VERIFY_OUTPUT_SIZE | ( | key_type, | |
| alg | |||
| ) |
A sufficient plaintext buffer size for ifx_se_aead_verify().
If the size of the plaintext buffer is at least this large, it is guaranteed that ifx_se_aead_verify() will not fail due to an insufficient plaintext buffer size. The actual size of the output may be smaller in any given call.
See also IFX_SE_AEAD_VERIFY_OUTPUT_MAX_SIZE.
| key_type | A symmetric key type that is compatible with algorithm alg. |
| alg | An AEAD algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_AEAD(alg) is true). |
| #define IFX_SE_AEAD_VERIFY_OUTPUT_MAX_SIZE (IFX_SE_BLOCK_CIPHER_BLOCK_MAX_SIZE) |
A sufficient plaintext buffer size for ifx_se_aead_verify(), for any of the supported key types and AEAD algorithms.
See also IFX_SE_AEAD_VERIFY_OUTPUT_SIZE(key_type, alg).
| #define IFX_SE_ECDSA_SIGNATURE_SIZE | ( | curve_bits | ) | (IFX_SE_BITS_TO_BYTES(curve_bits) * 2u) |
ECDSA signature size for a given curve bit size.
| curve_bits | Curve size in bits. |
| #define IFX_SE_SIGN_OUTPUT_SIZE | ( | key_type, | |
| key_bits, | |||
| alg | |||
| ) |
Sufficient signature buffer size for ifx_se_sign_hash().
This macro returns a sufficient buffer size for a signature using a key of the specified type and size, with the specified algorithm. Note that the actual size of the signature may be smaller (some algorithms produce a variable-size signature).
| key_type | An asymmetric key type (this may indifferently be a key pair type or a public key type). |
| key_bits | The size of the key in bits. |
| alg | The signature algorithm. |
| #define IFX_SE_SIGNATURE_MAX_SIZE 1 |
Maximum size of an asymmetric signature.
This macro expands to a compile-time constant integer. This value is the maximum size of a signature in bytes.
| #define IFX_SE_SIGNATURE_MAX_SIZE IFX_SE_BITS_TO_BYTES(IFX_SE_VENDOR_RSA_MAX_KEY_BITS) |
Maximum size of an asymmetric signature.
This macro expands to a compile-time constant integer. This value is the maximum size of a signature in bytes.
| #define IFX_SE_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE | ( | key_bits | ) | (2u * IFX_SE_BITS_TO_BYTES(key_bits) + 1u) |
Maximum size of the export encoding of an ECC public key.
The representation of an ECC public key is:
x_P as a ceiling(m/8)-byte string, big-endian;y_P as a ceiling(m/8)-byte string, big-endian;-> 1 byte + 2 * point size.
| #define IFX_SE_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE | ( | key_bits | ) | (IFX_SE_BITS_TO_BYTES(key_bits)) |
Maximum size of the export encoding of an ECC key pair.
An ECC key pair is represented by the secret value.
| #define IFX_SE_EXPORT_KEY_OUTPUT_SIZE | ( | key_type, | |
| key_bits | |||
| ) |
Sufficient output buffer size for ifx_se_export_key() or ifx_se_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 key by querying the key type and size at runtime.
| key_type | A supported key type. |
| key_bits | The size of the key in bits. |
| #define IFX_SE_EXPORT_PUBLIC_KEY_OUTPUT_SIZE | ( | key_type, | |
| key_bits | |||
| ) |
Sufficient output buffer size for ifx_se_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. |
If the parameters are valid and supported, return the same result as IFX_SE_EXPORT_KEY_OUTPUT_SIZE( IFX_SE_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(key_type), key_bits).
| #define IFX_SE_EXPORT_KEY_PAIR_MAX_SIZE IFX_SE_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(IFX_SE_VENDOR_ECC_MAX_CURVE_BITS) |
Sufficient buffer size for exporting any asymmetric key pair.
This macro expands to a compile-time constant integer. This value is a sufficient buffer size when calling ifx_se_export_key() to export any asymmetric key pair, regardless of the exact key type and key size.
See also IFX_SE_EXPORT_KEY_OUTPUT_SIZE(key_type, key_bits).
| #define IFX_SE_EXPORT_PUBLIC_KEY_MAX_SIZE IFX_SE_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(IFX_SE_VENDOR_ECC_MAX_CURVE_BITS) |
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 ifx_se_export_key() or ifx_se_export_public_key() to export any asymmetric public key, regardless of the exact key type and key size.
See also IFX_SE_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(key_type, key_bits).
| #define IFX_SE_RAW_KEY_AGREEMENT_OUTPUT_SIZE | ( | key_type, | |
| key_bits | |||
| ) |
Sufficient output buffer size for ifx_se_raw_key_agreement().
This macro returns a compile-time constant if its arguments are compile-time constants.
See also IFX_SE_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE.
| key_type | A supported key type. |
| key_bits | The size of the key in bits. |
| #define IFX_SE_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE 1 |
Maximum size of the output from ifx_se_raw_key_agreement().
This macro expands to a compile-time constant integer. This value is the maximum size of the output any raw key agreement algorithm, in bytes.
See also IFX_SE_RAW_KEY_AGREEMENT_OUTPUT_SIZE(key_type, key_bits).
| #define IFX_SE_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE IFX_SE_BITS_TO_BYTES(IFX_SE_VENDOR_ECC_MAX_CURVE_BITS) |
Maximum size of the output from ifx_se_raw_key_agreement().
This macro expands to a compile-time constant integer. This value is the maximum size of the output any raw key agreement algorithm, in bytes.
See also IFX_SE_RAW_KEY_AGREEMENT_OUTPUT_SIZE(key_type, key_bits).
| #define IFX_SE_CIPHER_IV_LENGTH | ( | key_type, | |
| alg | |||
| ) |
The default IV size for a cipher algorithm, in bytes.
The IV that is generated as part of a call to ifx_se_cipher_encrypt() is always the default IV length for the algorithm.
This macro can be used to allocate a buffer of sufficient size to store the IV output from ifx_se_cipher_generate_iv() when using a multi-part cipher operation.
See also IFX_SE_CIPHER_IV_MAX_SIZE.
| key_type | A symmetric key type that is compatible with algorithm alg. |
| alg | A cipher algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_CIPHER(alg) is true). |
| #define IFX_SE_CIPHER_IV_MAX_SIZE 16u |
The maximum IV size for all supported cipher algorithms, in bytes.
See also IFX_SE_CIPHER_IV_LENGTH().
| #define IFX_SE_CIPHER_ENCRYPT_OUTPUT_SIZE | ( | key_type, | |
| alg, | |||
| input_length | |||
| ) |
The maximum size of the output of ifx_se_cipher_encrypt(), in bytes.
If the size of the output buffer is at least this large, it is guaranteed that ifx_se_cipher_encrypt() will not fail due to an insufficient buffer size. Depending on the algorithm, the actual size of the output might be smaller.
See also IFX_SE_CIPHER_ENCRYPT_OUTPUT_MAX_SIZE(input_length).
| key_type | A symmetric key type that is compatible with algorithm alg. |
| alg | A cipher algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_CIPHER(alg) is true). |
| input_length | Size of the input in bytes. |
| #define IFX_SE_CIPHER_ENCRYPT_OUTPUT_MAX_SIZE | ( | input_length | ) |
A sufficient output buffer size for ifx_se_cipher_encrypt(), for any of the supported key types and cipher algorithms.
If the size of the output buffer is at least this large, it is guaranteed that ifx_se_cipher_encrypt() will not fail due to an insufficient buffer size.
See also IFX_SE_CIPHER_ENCRYPT_OUTPUT_SIZE(key_type, alg, input_length).
| input_length | Size of the input in bytes. |
| #define IFX_SE_CIPHER_DECRYPT_OUTPUT_SIZE | ( | key_type, | |
| alg, | |||
| input_length | |||
| ) |
The maximum size of the output of ifx_se_cipher_decrypt(), in bytes.
If the size of the output buffer is at least this large, it is guaranteed that ifx_se_cipher_decrypt() will not fail due to an insufficient buffer size. Depending on the algorithm, the actual size of the output might be smaller.
See also IFX_SE_CIPHER_DECRYPT_OUTPUT_MAX_SIZE(input_length).
| key_type | A symmetric key type that is compatible with algorithm alg. |
| alg | A cipher algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_CIPHER(alg) is true). |
| input_length | Size of the input in bytes. |
| #define IFX_SE_CIPHER_DECRYPT_OUTPUT_MAX_SIZE | ( | input_length | ) | (input_length) |
A sufficient output buffer size for ifx_se_cipher_decrypt(), for any of the supported key types and cipher algorithms.
If the size of the output buffer is at least this large, it is guaranteed that ifx_se_cipher_decrypt() will not fail due to an insufficient buffer size.
See also IFX_SE_CIPHER_DECRYPT_OUTPUT_SIZE(key_type, alg, input_length).
| input_length | Size of the input in bytes. |
| #define IFX_SE_CIPHER_UPDATE_OUTPUT_SIZE | ( | key_type, | |
| alg, | |||
| input_length | |||
| ) |
A sufficient output buffer size for ifx_se_cipher_update().
If the size of the output buffer is at least this large, it is guaranteed that ifx_se_cipher_update() will not fail due to an insufficient buffer size. The actual size of the output might be smaller in any given call.
See also IFX_SE_CIPHER_UPDATE_OUTPUT_MAX_SIZE(input_length).
| key_type | A symmetric key type that is compatible with algorithm alg. |
| alg | A cipher algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_CIPHER(alg) is true). |
| input_length | Size of the input in bytes. |
| #define IFX_SE_CIPHER_UPDATE_OUTPUT_MAX_SIZE | ( | input_length | ) | (IFX_SE_ROUND_UP_TO_MULTIPLE(IFX_SE_BLOCK_CIPHER_BLOCK_MAX_SIZE, input_length)) |
A sufficient output buffer size for ifx_se_cipher_update(), for any of the supported key types and cipher algorithms.
If the size of the output buffer is at least this large, it is guaranteed that ifx_se_cipher_update() will not fail due to an insufficient buffer size.
See also IFX_SE_CIPHER_UPDATE_OUTPUT_SIZE(key_type, alg, input_length).
| input_length | Size of the input in bytes. |
| #define IFX_SE_CIPHER_FINISH_OUTPUT_SIZE | ( | key_type, | |
| alg | |||
| ) |
A sufficient ciphertext buffer size for ifx_se_cipher_finish().
If the size of the ciphertext buffer is at least this large, it is guaranteed that ifx_se_cipher_finish() will not fail due to an insufficient ciphertext buffer size. The actual size of the output might be smaller in any given call.
See also IFX_SE_CIPHER_FINISH_OUTPUT_MAX_SIZE().
| key_type | A symmetric key type that is compatible with algorithm alg. |
| alg | A cipher algorithm (IFX_SE_ALG_XXX value such that IFX_SE_ALG_IS_CIPHER(alg) is true). |
| #define IFX_SE_CIPHER_FINISH_OUTPUT_MAX_SIZE (IFX_SE_BLOCK_CIPHER_BLOCK_MAX_SIZE) |
A sufficient ciphertext buffer size for ifx_se_cipher_finish(), for any of the supported key types and cipher algorithms.
See also IFX_SE_CIPHER_FINISH_OUTPUT_SIZE(key_type, alg).