From 9ac9426731a58cee9b13b7184e457c00fc54ac52 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 12 Jul 2018 20:15:32 +0200 Subject: [PATCH] Doc: clarify the preconditions for psa_cipher_update --- include/psa/crypto.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/psa/crypto.h b/include/psa/crypto.h index 4b2e9a0aa..8a80620dd 100644 --- a/include/psa/crypto.h +++ b/include/psa/crypto.h @@ -1963,12 +1963,12 @@ psa_status_t psa_cipher_set_iv(psa_cipher_operation_t *operation, /** Encrypt or decrypt a message fragment in an active cipher operation. * - * The application must call psa_cipher_encrypt_setup() or - * psa_cipher_decrypt_setup() before calling this function. The choice - * of setup function determines whether this function encrypts or - * decrypts its input. After calling a setup function, if the chosen - * algorithm requires an IV, the application must call - * psa_cipher_generate_iv() or psa_cipher_set_iv(). + * Before calling this function, you must: + * 1. Call either psa_cipher_encrypt_setup() or psa_cipher_decrypt_setup(). + * The choice of setup function determines whether this function + * encrypts or decrypts its input. + * 2. If the algorithm requires an IV, call psa_cipher_generate_iv() + * (recommended when encrypting) or psa_cipher_set_iv(). * * If this function returns an error status, the operation becomes inactive. *