Skip to content

Commit d7a6869

Browse files
committed
psa: Document generator requirements consistently
We've added documentation for how context objects for multi-part operations must be initialized consistently for key policy, hash, cipher, and MAC. Update the generator documentation to be consistent with how we've documented the other operations.
1 parent 780822e commit d7a6869

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

include/psa/crypto.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,11 +2099,9 @@ psa_status_t psa_generator_abort(psa_crypto_generator_t *generator);
20992099
* - For HKDF (#PSA_ALG_HKDF), \p salt is the salt used in the "extract" step
21002100
* and \p label is the info string used in the "expand" step.
21012101
*
2102-
* \param[in,out] generator The generator object to set up. It must
2103-
* have been initialized to all-bits-zero,
2104-
* a logical zero (`{0}`),
2105-
* \c PSA_CRYPTO_GENERATOR_INIT or
2106-
* psa_crypto_generator_init().
2102+
* \param[in,out] generator The generator object to set up. It must have
2103+
* been initialized as per the documentation for
2104+
* #psa_crypto_generator_t and not yet in use.
21072105
* \param handle Handle to the secret key.
21082106
* \param alg The key derivation algorithm to compute
21092107
* (\c PSA_ALG_XXX value such that
@@ -2153,11 +2151,9 @@ psa_status_t psa_key_derivation(psa_crypto_generator_t *generator,
21532151
* The resulting generator always has the maximum capacity permitted by
21542152
* the algorithm.
21552153
*
2156-
* \param[in,out] generator The generator object to set up. It must
2157-
* have been initialized to all-bits-zero,
2158-
* a logical zero (`{0}`),
2159-
* \c PSA_CRYPTO_GENERATOR_INIT or
2160-
* psa_crypto_generator_init().
2154+
* \param[in,out] generator The generator object to set up. It must have
2155+
* been initialized as per the documentation for
2156+
* #psa_crypto_generator_t and not yet in use.
21612157
* \param private_key Handle to the private key to use.
21622158
* \param[in] peer_key Public key of the peer. It must be
21632159
* in the same format that psa_import_key()

0 commit comments

Comments
 (0)