Re: [PATCH v8 1/4] crypto: AF_ALG -- add sign/verify API
From: Stephan Mueller <hidden>
Date: 2017-08-10 13:03:41
Am Donnerstag, 10. August 2017, 14:49:39 CEST schrieb Tudor Ambarus: Hi Tudor, thanks for reviewing
quoted
- err = ctx->enc ? crypto_aead_encrypt(&areq->cra_u.aead_req) : - crypto_aead_decrypt(&areq->cra_u.aead_req); - } else { + } elseUnbalanced braces around else statement.
Is there a style requirement for that? checkpatch.pl does not complain. I thought that one liners in a conditional should not have braces?
quoted
- ctx->enc = 0; + ctx->op = 0;This implies decryption. Should we change the value of ALG_OP_DECRYPT?
ALG_OP_DECRYPT is a user space interface, so we cannot change it. Do you see harm in leaving it as is? Note, I did not want to introduce functional changes that have no bearing on the addition of the sign/verify API. If you think this is problematic, I would like to add another patch that is dedicated to fix this.
quoted
- err = ctx->enc ? - crypto_skcipher_encrypt(&areq->cra_u.skcipher_req) : - crypto_skcipher_decrypt(&areq->cra_u.skcipher_req); - } else { + } elseUnbalanced braces around else statement.
Same as above. Thanks a lot! Ciao Stephan