crypto: return codes
Hi,
Looking at different examples of the same crypto call, it's unclear whether it only returns negative error values. Some examples only test for negative values, while others test for not 0. tcrypt.c does "if (ret)". Would appreciate some clarification.
thanks,
Mimi
Herbert Xu
maintainerQuoted 6 lines · Mimi Zohar
Hi,
Looking at different examples of the same crypto call, it's unclear whether it only returns negative error values. Some examples only test for negative values, while others test for not 0.
tcrypt.cdoes "if (ret)". Would appreciate some clarification.
Unless the call can return positive values then it makes no difference. Which particular call are you talking about?
Cheers,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Quoted 8 lines · Herbert Xu
Quoted 6 lines · Mimi Zohar
Hi,
Looking at different examples of the same crypto call, it's unclear whether it only returns negative error values. Some examples only test for negative values, while others test for not 0.
tcrypt.cdoes "if (ret)". Would appreciate some clarification.
Quoted 4 lines
Unless the call can return positive values then it makes no difference. Which particular call are you talking about?
Cheers,
Just to name a few: crypto_hash_init(), crypto_hash_update(), crypto_hash_final(). Also crypto_blkcipher_decrypt/encrypt(). Would be nice to know definitively that they return < 0 on error and 0 for success.
thanks!
Mimi
Herbert Xu
maintainerQuoted 12 lines · Mimi Zohar
Quoted 11 lines · Herbert Xu
Quoted 6 lines · Mimi Zohar
Hi,
Looking at different examples of the same crypto call, it's unclear whether it only returns negative error values. Some examples only test for negative values, while others test for not 0.
tcrypt.cdoes "if (ret)". Would appreciate some clarification.Unless the call can return positive values then it makes no difference. Which particular call are you talking about?
Quoted 6 lines
Quoted 1 line
Cheers,
Just to name a few:
crypto_hash_init(),crypto_hash_update(),crypto_hash_final(). Also crypto_blkcipher_decrypt/encrypt(). Would be nice to know definitively that they return < 0 on error and 0 for success.
Yes it's zero or negative.
Cheers,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt