Skip to content

Commit 214064e

Browse files
committed
Xref documentation for ECC curves and DH groups.
Connect the types to the key type construction macros by x-refs.
1 parent fd368e5 commit 214064e

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

include/psa/crypto_types.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ typedef int32_t psa_status_t;
6666
typedef uint32_t psa_key_type_t;
6767

6868
/** The type of PSA elliptic curve identifiers.
69+
*
70+
* The curve identifier is required to create an ECC key using the
71+
* PSA_KEY_TYPE_ECC_KEY_PAIR() or PSA_KEY_TYPE_ECC_PUBLIC_KEY()
72+
* macros.
6973
*
7074
* The encoding of curve identifiers is taken from the
7175
* TLS Supported Groups Registry (formerly known as the
@@ -89,6 +93,10 @@ typedef uint32_t psa_key_type_t;
8993
typedef uint16_t psa_ecc_curve_t;
9094

9195
/** The type of PSA Diffie-Hellman group identifiers.
96+
*
97+
* The group identifier is required to create an Diffie-Hellman key using the
98+
* PSA_KEY_TYPE_DH_KEY_PAIR() or PSA_KEY_TYPE_DH_PUBLIC_KEY()
99+
* macros.
92100
*
93101
* The encoding of group identifiers is taken from the
94102
* TLS Supported Groups Registry (formerly known as the

include/psa/crypto_values.h

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,18 @@
421421
#define PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE ((psa_key_type_t)0x60030000)
422422
#define PSA_KEY_TYPE_ECC_KEY_PAIR_BASE ((psa_key_type_t)0x70030000)
423423
#define PSA_KEY_TYPE_ECC_CURVE_MASK ((psa_key_type_t)0x0000ffff)
424-
/** Elliptic curve key pair. */
424+
/** Elliptic curve key pair.
425+
*
426+
* \param curve A value of type ::psa_ecc_curve_t that identifies the
427+
* ECC curve to be used.
428+
*/
425429
#define PSA_KEY_TYPE_ECC_KEY_PAIR(curve) \
426430
(PSA_KEY_TYPE_ECC_KEY_PAIR_BASE | (curve))
427-
/** Elliptic curve public key. */
431+
/** Elliptic curve public key.
432+
*
433+
* \param curve A value of type ::psa_ecc_curve_t that identifies the
434+
* ECC curve to be used.
435+
*/
428436
#define PSA_KEY_TYPE_ECC_PUBLIC_KEY(curve) \
429437
(PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE | (curve))
430438

@@ -511,10 +519,18 @@
511519
#define PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE ((psa_key_type_t)0x60040000)
512520
#define PSA_KEY_TYPE_DH_KEY_PAIR_BASE ((psa_key_type_t)0x70040000)
513521
#define PSA_KEY_TYPE_DH_GROUP_MASK ((psa_key_type_t)0x0000ffff)
514-
/** Diffie-Hellman key pair. */
522+
/** Diffie-Hellman key pair.
523+
*
524+
* \param group A value of type ::psa_dh_group_t that identifies the
525+
* Diffie-Hellman group to be used.
526+
*/
515527
#define PSA_KEY_TYPE_DH_KEY_PAIR(group) \
516528
(PSA_KEY_TYPE_DH_KEY_PAIR_BASE | (group))
517-
/** Diffie-Hellman public key. */
529+
/** Diffie-Hellman public key.
530+
*
531+
* \param group A value of type ::psa_dh_group_t that identifies the
532+
* Diffie-Hellman group to be used.
533+
*/
518534
#define PSA_KEY_TYPE_DH_PUBLIC_KEY(group) \
519535
(PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE | (group))
520536

0 commit comments

Comments
 (0)