blob: ad0e8cc321c58794878b71f6ece573521b1ee32d [file] [log] [blame]
Antonio de Angelis8908f472018-08-31 15:44:25 +01001/*
Summer Qinf07cc312022-01-05 16:52:54 +08002 * Copyright (c) 2018-2022, Arm Limited. All rights reserved.
Antonio de Angelis8908f472018-08-31 15:44:25 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
Antonio de Angelis8908f472018-08-31 15:44:25 +01007/**
Jamie Foxcc31d402019-01-28 17:13:52 +00008 * \file psa/crypto_extra.h
Antonio de Angelis8908f472018-08-31 15:44:25 +01009 *
10 * \brief PSA cryptography module: vendor extensions
Antonio de Angelis377a1552018-11-22 17:02:40 +000011 *
12 * \note This file may not be included directly. Applications must
Jamie Foxcc31d402019-01-28 17:13:52 +000013 * include psa/crypto.h.
Antonio de Angelis377a1552018-11-22 17:02:40 +000014 *
15 * This file is reserved for vendor-specific definitions.
Antonio de Angelis8908f472018-08-31 15:44:25 +010016 */
17
Antonio de Angelis377a1552018-11-22 17:02:40 +000018#ifndef PSA_CRYPTO_EXTRA_H
19#define PSA_CRYPTO_EXTRA_H
Antonio de Angelis8908f472018-08-31 15:44:25 +010020
Summer Qinf07cc312022-01-05 16:52:54 +080021#include "psa/crypto_types.h"
Antonio de Angelis04debbd2019-10-14 12:12:52 +010022#include "psa/crypto_compat.h"
23
Antonio de Angelis8908f472018-08-31 15:44:25 +010024#ifdef __cplusplus
25extern "C" {
26#endif
27
Soby Mathewf5cd3692020-05-12 22:46:47 +010028/** \addtogroup crypto_types
29 * @{
30 */
31
32/** DSA public key.
33 *
34 * The import and export format is the
35 * representation of the public key `y = g^x mod p` as a big-endian byte
36 * string. The length of the byte string is the length of the base prime `p`
37 * in bytes.
38 */
Soby Mathew07ef6e42020-07-20 21:09:23 +010039#define PSA_KEY_TYPE_DSA_PUBLIC_KEY ((psa_key_type_t)0x4002)
Soby Mathewf5cd3692020-05-12 22:46:47 +010040
41/** DSA key pair (private and public key).
42 *
43 * The import and export format is the
44 * representation of the private key `x` as a big-endian byte string. The
45 * length of the byte string is the private key size in bytes (leading zeroes
46 * are not stripped).
47 *
48 * Determinstic DSA key derivation with psa_generate_derived_key follows
49 * FIPS 186-4 §B.1.2: interpret the byte string as integer
50 * in big-endian order. Discard it if it is not in the range
51 * [0, *N* - 2] where *N* is the boundary of the private key domain
52 * (the prime *p* for Diffie-Hellman, the subprime *q* for DSA,
53 * or the order of the curve's base point for ECC).
54 * Add 1 to the resulting integer and use this as the private key *x*.
55 *
56 */
Soby Mathew07ef6e42020-07-20 21:09:23 +010057#define PSA_KEY_TYPE_DSA_KEY_PAIR ((psa_key_type_t)0x7002)
Soby Mathewf5cd3692020-05-12 22:46:47 +010058
59/**@}*/
60
Antonio de Angelis8908f472018-08-31 15:44:25 +010061#ifdef __cplusplus
62}
63#endif
64
Antonio de Angelis377a1552018-11-22 17:02:40 +000065#endif /* PSA_CRYPTO_EXTRA_H */