@@ -381,6 +381,21 @@ psa_status_t psa_get_key_information(psa_key_handle_t handle,
381
381
* g INTEGER
382
382
* }
383
383
* ```
384
+ * - For Diffie-Hellman key exchange keys (#PSA_KEY_TYPE_DH_PUBLIC_KEY), the
385
+ * `DomainParameters` format as defined by RFC 3279 §2.3.3.
386
+ * ```
387
+ * DomainParameters ::= SEQUENCE {
388
+ * p INTEGER, -- odd prime, p=jq +1
389
+ * g INTEGER, -- generator, g
390
+ * q INTEGER, -- factor of p-1
391
+ * j INTEGER OPTIONAL, -- subgroup factor
392
+ * validationParms ValidationParms OPTIONAL
393
+ * }
394
+ * ValidationParms ::= SEQUENCE {
395
+ * seed BIT STRING,
396
+ * pgenCounter INTEGER
397
+ * }
398
+ * ```
384
399
* Must call before import key. If you want, you can call before generate key
385
400
* or use extra to pass the domain parameters.
386
401
*
@@ -446,6 +461,9 @@ psa_status_t psa_get_key_domain_parameters(uint8_t *data,
446
461
* and `PSA_ECC_CURVE_BRAINPOOL_PXXX`).
447
462
* This is the content of the `privateKey` field of the `ECPrivateKey`
448
463
* format defined by RFC 5915.
464
+ * - For Diffie-Hellman key exchange key pairs (#PSA_KEY_TYPE_DH_KEYPAIR), the
465
+ * format is a representation of the private key `x` as a big-endian byte
466
+ * string.
449
467
* - For public keys (key types for which #PSA_KEY_TYPE_IS_PUBLIC_KEY is
450
468
* true), the format is the same as for psa_export_public_key().
451
469
*
@@ -519,6 +537,9 @@ psa_status_t psa_export_key(psa_key_handle_t handle,
519
537
* -- where `m` is the bit size associated with the curve,
520
538
* -- i.e. the bit size of `q` for a curve over `F_q`.
521
539
* ```
540
+ * - For Diffie-Hellman key exchange public keys (#PSA_KEY_TYPE_DH_PUBLIC_KEY),
541
+ * the format is a representation of the public key `y` (`g^x mod p`) as a
542
+ * big-endian byte string.
522
543
*
523
544
* \param handle Handle to the key to export.
524
545
* \param[out] data Buffer where the key data is to be written.
@@ -2256,6 +2277,12 @@ typedef struct {
2256
2277
* parameters. The key domain parameters can also be
2257
2278
* provided by psa_set_key_domain_parameters(),
2258
2279
* which documents the format of the structure.
2280
+ * - For a DH key (\p type is
2281
+ * #PSA_KEY_TYPE_DH_KEYPAIR), the \p extra is an
2282
+ * optional structure specifying the key domain
2283
+ * parameters. The key domain parameters can also be
2284
+ * provided by psa_set_key_domain_parameters(),
2285
+ * which documents the format of the structure.
2259
2286
* \param extra_size Size of the buffer that \p extra
2260
2287
* points to, in bytes. Note that if \p extra is
2261
2288
* \c NULL then \p extra_size must be zero.
0 commit comments