diff options
author | Soby Mathew <soby.mathew@arm.com> | 2020-05-12 22:46:47 +0100 |
---|---|---|
committer | Soby Mathew <soby.mathew@arm.com> | 2020-05-15 07:56:43 +0000 |
commit | f5cd3693f61a499b9ae64ddd4d58460823768098 (patch) | |
tree | bc4cb304564873c7346bdc63462758e9c5fa5aff /interface | |
parent | 7564106bc7735fbdcc98a3c41715e3535eff9a1c (diff) | |
download | trusted-firmware-m-f5cd3693f61a499b9ae64ddd4d58460823768098.tar.gz |
Crypto: Import additional macros from crypto_extra.h in mbedcrypto
During the migration to latest tag of mbedcrypto, some of the exported headers
from TF-M was cleaned up which resulted in removing some needed macros in
crypto_extra.h header as well. This patch copies some of the needed macros
from the mbedcrypto header to the TF-M exported header. This issue was detected
when the NS app tried to use the PSA_KEY_EXPORT_MAX_SIZE macro.
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Change-Id: I97a9535f7c68b402098c05f753547588793514b5
Diffstat (limited to 'interface')
-rw-r--r-- | interface/include/psa/crypto_extra.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/interface/include/psa/crypto_extra.h b/interface/include/psa/crypto_extra.h index 356362f707..f1ba6904a9 100644 --- a/interface/include/psa/crypto_extra.h +++ b/interface/include/psa/crypto_extra.h @@ -24,6 +24,39 @@ extern "C" { #endif +/** \addtogroup crypto_types + * @{ + */ + +/** DSA public key. + * + * The import and export format is the + * representation of the public key `y = g^x mod p` as a big-endian byte + * string. The length of the byte string is the length of the base prime `p` + * in bytes. + */ +#define PSA_KEY_TYPE_DSA_PUBLIC_KEY ((psa_key_type_t)0x60020000) + +/** DSA key pair (private and public key). + * + * The import and export format is the + * representation of the private key `x` as a big-endian byte string. The + * length of the byte string is the private key size in bytes (leading zeroes + * are not stripped). + * + * Determinstic DSA key derivation with psa_generate_derived_key follows + * FIPS 186-4 §B.1.2: interpret the byte string as integer + * in big-endian order. Discard it if it is not in the range + * [0, *N* - 2] where *N* is the boundary of the private key domain + * (the prime *p* for Diffie-Hellman, the subprime *q* for DSA, + * or the order of the curve's base point for ECC). + * Add 1 to the resulting integer and use this as the private key *x*. + * + */ +#define PSA_KEY_TYPE_DSA_KEY_PAIR ((psa_key_type_t)0x70020000) + +/**@}*/ + #ifdef __cplusplus } #endif |