Skip to content

Commit fd368e5

Browse files
committed
Support for vendor-defined ECC curves and DH groups
Define a vendor-range within the the private use ranges in the IANA registry. Provide recommendations for how to support vendor-defined curves and groups.
1 parent c625045 commit fd368e5

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

include/psa/crypto_types.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ typedef uint32_t psa_key_type_t;
7676
* This specification defines identifiers for some of the curves in the IANA
7777
* registry. Implementations that support other curves that are in the IANA
7878
* registry should use the IANA value and a implementation-specific identifier.
79+
* Implemenations that support non-IANA curves should use one of the following
80+
* approaches for allocating a key type:
81+
*
82+
* 1. Select a ::psa_ecc_curve_t value in the range #PSA_ECC_CURVE_VENDOR_MIN to
83+
* #PSA_ECC_CURVE_VENDOR_MAX, which is a subset of the IANA private use
84+
* range.
85+
* 2. Use a ::psa_key_type_t value that is vendor-defined.
86+
*
87+
* The first option is recommended.
7988
*/
8089
typedef uint16_t psa_ecc_curve_t;
8190

@@ -90,6 +99,15 @@ typedef uint16_t psa_ecc_curve_t;
9099
* This specification defines identifiers for some of the groups in the IANA
91100
* registry. Implementations that support other groups that are in the IANA
92101
* registry should use the IANA value and a implementation-specific identifier.
102+
* Implemenations that support non-IANA groups should use one of the following
103+
* approaches for allocating a key type:
104+
*
105+
* 1. Select a ::psa_dh_group_t value in the range #PSA_DH_GROUP_VENDOR_MIN to
106+
* #PSA_DH_GROUP_VENDOR_MAX, which is a subset of the IANA private use
107+
* range.
108+
* 2. Use a ::psa_key_type_t value that is vendor-defined.
109+
*
110+
* The first option is recommended.
93111
*/
94112
typedef uint16_t psa_dh_group_t;
95113

include/psa/crypto_values.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,19 @@
495495
*/
496496
#define PSA_ECC_CURVE_CURVE448 ((psa_ecc_curve_t) 0x001e)
497497

498+
/** Minimum value for a vendor-defined ECC curve identifier
499+
*
500+
* The range for vendor-defined curve identifiers is a subset of the IANA
501+
* registry private use range, `0xfe00` - `0xfeff`.
502+
*/
503+
#define PSA_ECC_CURVE_VENDOR_MIN ((psa_ecc_curve_t) 0xfe00)
504+
/** Maximum value for a vendor-defined ECC curve identifier
505+
*
506+
* The range for vendor-defined curve identifiers is a subset of the IANA
507+
* registry private use range, `0xfe00` - `0xfeff`.
508+
*/
509+
#define PSA_ECC_CURVE_VENDOR_MAX ((psa_ecc_curve_t) 0xfe7f)
510+
498511
#define PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE ((psa_key_type_t)0x60040000)
499512
#define PSA_KEY_TYPE_DH_KEY_PAIR_BASE ((psa_key_type_t)0x70040000)
500513
#define PSA_KEY_TYPE_DH_GROUP_MASK ((psa_key_type_t)0x0000ffff)
@@ -535,6 +548,19 @@
535548
#define PSA_DH_GROUP_FFDHE6144 ((psa_dh_group_t) 0x0103)
536549
#define PSA_DH_GROUP_FFDHE8192 ((psa_dh_group_t) 0x0104)
537550

551+
/** Minimum value for a vendor-defined Diffie Hellman group identifier
552+
*
553+
* The range for vendor-defined group identifiers is a subset of the IANA
554+
* registry private use range, `0x01fc` - `0x01ff`.
555+
*/
556+
#define PSA_DH_GROUP_VENDOR_MIN ((psa_dh_group_t) 0x01fc)
557+
/** Maximum value for a vendor-defined Diffie Hellman group identifier
558+
*
559+
* The range for vendor-defined group identifiers is a subset of the IANA
560+
* registry private use range, `0x01fc` - `0x01ff`.
561+
*/
562+
#define PSA_DH_GROUP_VENDOR_MAX ((psa_dh_group_t) 0x01fd)
563+
538564
/** The block size of a block cipher.
539565
*
540566
* \param type A cipher key type (value of type #psa_key_type_t).

0 commit comments

Comments
 (0)