Skip to content

Commit

Permalink
Document more error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
gilles-peskine-arm committed Jul 18, 2019
1 parent 8fe3687 commit 569874e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion include/psa/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -1012,8 +1012,10 @@ static psa_hash_operation_t psa_hash_operation_init(void);
*
* \retval #PSA_SUCCESS
* Success.
* \retval #PSA_ERROR_INVALID_ARGUMENT
* \p alg is not a hash algorithm.
* \retval #PSA_ERROR_NOT_SUPPORTED
* \p alg is not supported or is not a hash algorithm.
* \p alg is not a supported hash algorithm.
* \retval #PSA_ERROR_BAD_STATE
* The operation state is not valid (already set up and not
* subsequently completed).
Expand Down Expand Up @@ -1951,6 +1953,14 @@ psa_status_t psa_cipher_update(psa_cipher_operation_t *operation,
*
* \retval #PSA_SUCCESS
* Success.
* \retval #PSA_ERROR_INVALID_ARGUMENT
* The total input size passed to this operation is not valid for
* this particular algorithm. For example, the algorithm is a based
* on block cipher and requires a whole number of blocks, but the
* total input size is not a multiple of the block size.
* \retval #PSA_ERROR_INVALID_PADDING
* This is a decryption operation for an algorithm that includes
* padding, and the ciphertext does not contain valid padding.
* \retval #PSA_ERROR_BAD_STATE
* The operation state is not valid (not set up, IV required but
* not set, or already completed).
Expand Down Expand Up @@ -2695,6 +2705,7 @@ psa_status_t psa_aead_abort(psa_aead_operation_t *operation);
* that make up the returned signature value.
*
* \retval #PSA_SUCCESS
* \retval #PSA_ERROR_NOT_PERMITTED
* \retval #PSA_ERROR_BUFFER_TOO_SMALL
* The size of the \p signature buffer is too small. You can
* determine a sufficient buffer size by calling
Expand Down Expand Up @@ -2745,6 +2756,7 @@ psa_status_t psa_asymmetric_sign(psa_key_handle_t handle,
* \retval #PSA_ERROR_INVALID_SIGNATURE
* The calculation was perfomed successfully, but the passed
* signature is not a valid signature.
* \retval #PSA_ERROR_NOT_PERMITTED
* \retval #PSA_ERROR_NOT_SUPPORTED
* \retval #PSA_ERROR_INVALID_ARGUMENT
* \retval #PSA_ERROR_INSUFFICIENT_MEMORY
Expand Down Expand Up @@ -2792,6 +2804,7 @@ psa_status_t psa_asymmetric_verify(psa_key_handle_t handle,
* that make up the returned output.
*
* \retval #PSA_SUCCESS
* \retval #PSA_ERROR_NOT_PERMITTED
* \retval #PSA_ERROR_BUFFER_TOO_SMALL
* The size of the \p output buffer is too small. You can
* determine a sufficient buffer size by calling
Expand Down Expand Up @@ -2848,6 +2861,7 @@ psa_status_t psa_asymmetric_encrypt(psa_key_handle_t handle,
* that make up the returned output.
*
* \retval #PSA_SUCCESS
* \retval #PSA_ERROR_NOT_PERMITTED
* \retval #PSA_ERROR_BUFFER_TOO_SMALL
* The size of the \p output buffer is too small. You can
* determine a sufficient buffer size by calling
Expand Down
2 changes: 1 addition & 1 deletion include/psa/crypto_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
*
* \warning If a function returns this error, it is undetermined
* whether the requested action has completed or not. Implementations
* should return #PSA_SUCCESS on successful completion whenver
* should return #PSA_SUCCESS on successful completion whenever
* possible, however functions may return #PSA_ERROR_COMMUNICATION_FAILURE
* if the requested action was completed successfully in an external
* cryptoprocessor but there was a breakdown of communication before
Expand Down

0 comments on commit 569874e

Please sign in to comment.