Antonio de Angelis | 8908f47 | 2018-08-31 15:44:25 +0100 | [diff] [blame] | 1 | /* |
Antonio de Angelis | 04debbd | 2019-10-14 12:12:52 +0100 | [diff] [blame] | 2 | * Copyright (c) 2018-2020, Arm Limited. All rights reserved. |
Antonio de Angelis | 8908f47 | 2018-08-31 15:44:25 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
Antonio de Angelis | 8908f47 | 2018-08-31 15:44:25 +0100 | [diff] [blame] | 7 | /** |
Jamie Fox | cc31d40 | 2019-01-28 17:13:52 +0000 | [diff] [blame] | 8 | * \file psa/crypto_extra.h |
Antonio de Angelis | 8908f47 | 2018-08-31 15:44:25 +0100 | [diff] [blame] | 9 | * |
| 10 | * \brief PSA cryptography module: vendor extensions |
Antonio de Angelis | 377a155 | 2018-11-22 17:02:40 +0000 | [diff] [blame] | 11 | * |
| 12 | * \note This file may not be included directly. Applications must |
Jamie Fox | cc31d40 | 2019-01-28 17:13:52 +0000 | [diff] [blame] | 13 | * include psa/crypto.h. |
Antonio de Angelis | 377a155 | 2018-11-22 17:02:40 +0000 | [diff] [blame] | 14 | * |
| 15 | * This file is reserved for vendor-specific definitions. |
Antonio de Angelis | 8908f47 | 2018-08-31 15:44:25 +0100 | [diff] [blame] | 16 | */ |
| 17 | |
Antonio de Angelis | 377a155 | 2018-11-22 17:02:40 +0000 | [diff] [blame] | 18 | #ifndef PSA_CRYPTO_EXTRA_H |
| 19 | #define PSA_CRYPTO_EXTRA_H |
Antonio de Angelis | 8908f47 | 2018-08-31 15:44:25 +0100 | [diff] [blame] | 20 | |
Antonio de Angelis | 04debbd | 2019-10-14 12:12:52 +0100 | [diff] [blame] | 21 | #include "psa/crypto_compat.h" |
| 22 | |
Antonio de Angelis | 8908f47 | 2018-08-31 15:44:25 +0100 | [diff] [blame] | 23 | #ifdef __cplusplus |
| 24 | extern "C" { |
| 25 | #endif |
| 26 | |
Soby Mathew | f5cd369 | 2020-05-12 22:46:47 +0100 | [diff] [blame^] | 27 | /** \addtogroup crypto_types |
| 28 | * @{ |
| 29 | */ |
| 30 | |
| 31 | /** DSA public key. |
| 32 | * |
| 33 | * The import and export format is the |
| 34 | * representation of the public key `y = g^x mod p` as a big-endian byte |
| 35 | * string. The length of the byte string is the length of the base prime `p` |
| 36 | * in bytes. |
| 37 | */ |
| 38 | #define PSA_KEY_TYPE_DSA_PUBLIC_KEY ((psa_key_type_t)0x60020000) |
| 39 | |
| 40 | /** DSA key pair (private and public key). |
| 41 | * |
| 42 | * The import and export format is the |
| 43 | * representation of the private key `x` as a big-endian byte string. The |
| 44 | * length of the byte string is the private key size in bytes (leading zeroes |
| 45 | * are not stripped). |
| 46 | * |
| 47 | * Determinstic DSA key derivation with psa_generate_derived_key follows |
| 48 | * FIPS 186-4 §B.1.2: interpret the byte string as integer |
| 49 | * in big-endian order. Discard it if it is not in the range |
| 50 | * [0, *N* - 2] where *N* is the boundary of the private key domain |
| 51 | * (the prime *p* for Diffie-Hellman, the subprime *q* for DSA, |
| 52 | * or the order of the curve's base point for ECC). |
| 53 | * Add 1 to the resulting integer and use this as the private key *x*. |
| 54 | * |
| 55 | */ |
| 56 | #define PSA_KEY_TYPE_DSA_KEY_PAIR ((psa_key_type_t)0x70020000) |
| 57 | |
| 58 | /**@}*/ |
| 59 | |
Antonio de Angelis | 8908f47 | 2018-08-31 15:44:25 +0100 | [diff] [blame] | 60 | #ifdef __cplusplus |
| 61 | } |
| 62 | #endif |
| 63 | |
Antonio de Angelis | 377a155 | 2018-11-22 17:02:40 +0000 | [diff] [blame] | 64 | #endif /* PSA_CRYPTO_EXTRA_H */ |