@@ -2924,12 +2924,31 @@ psa_status_t psa_generator_read(psa_crypto_generator_t *generator,
2924
2924
* for the output produced by psa_export_key().
2925
2925
* The following key types defined in this specification follow this scheme:
2926
2926
*
2927
- * - #PSA_KEY_TYPE_DES;
2928
- * - #PSA_KEY_TYPE_DH_KEYPAIR;
2929
- * - #PSA_KEY_TYPE_DSA_KEYPAIR;
2930
- * - ECC keys on a Weierstrass elliptic curve, i.e.
2931
- * #PSA_KEY_TYPE_ECC_KEYPAIR(\c curve) where \c curve designates a
2932
- * Weierstrass curve.
2927
+ * - #PSA_KEY_TYPE_DES.
2928
+ * Force-set the parity bits, but discard forbidden weak keys.
2929
+ * For 2-key and 3-key triple-DES, the three keys are generated
2930
+ * successively (for example, for 3-key triple-DES,
2931
+ * if the first 8 bytes specify a weak key and the next 8 bytes do not,
2932
+ * discard the first 8 bytes, use the next 8 bytes as the first key,
2933
+ * and continue reading output from the generator to derive the other
2934
+ * two keys).
2935
+ * - Finite-field Diffie-Hellman keys (#PSA_KEY_TYPE_DH_KEYPAIR),
2936
+ * DSA keys (#PSA_KEY_TYPE_DSA_KEYPAIR), and
2937
+ * ECC keys on a Weierstrass elliptic curve
2938
+ * (#PSA_KEY_TYPE_ECC_KEYPAIR(\c curve) where \c curve designates a
2939
+ * Weierstrass curve).
2940
+ * For these key types, interpret the byte string as integer
2941
+ * in big-endian order. Discard it if it is not in the range
2942
+ * [0, *N* - 2] where *N* is the boundary of the private key domain
2943
+ * (the prime *p* for Diffie-Hellman, the subprime *q* for DSA,
2944
+ * or the order of the curve's coordinate field for ECC).
2945
+ * Add 1 to the resulting integer and use this as the private key *x*.
2946
+ * This is the method described as
2947
+ * "key-pair generation by testing candidates"
2948
+ * in NIST SP 800-56A §5.6.1.1.4 for Diffie-Hellman,
2949
+ * in FIPS 186-4 §B.1.2 for DSA, and
2950
+ * in NIST SP 800-56A §5.6.1.2.2 or
2951
+ * FIPS 186-4 §B.4.2 for elliptic curve keys.
2933
2952
*
2934
2953
* - For other key types, including #PSA_KEY_TYPE_RSA_KEYPAIR,
2935
2954
* the way in which the generator output is consumed is
0 commit comments