Skip to content

Commit 8fd9115

Browse files
tititiou36herbertx
authored andcommitted
crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs()
SS_ENCRYPTION is (0 << 7 = 0), so the test can never be true. Use a direct comparison to SS_ENCRYPTION instead. The same king of test is already done the same way in sun8i_ss_run_task(). Fixes: 359e893 ("crypto: sun8i-ss - rework handling of IV") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 482c84e commit 8fd9115

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static int sun8i_ss_setup_ivs(struct skcipher_request *areq)
151151
}
152152
rctx->p_iv[i] = a;
153153
/* we need to setup all others IVs only in the decrypt way */
154-
if (rctx->op_dir & SS_ENCRYPTION)
154+
if (rctx->op_dir == SS_ENCRYPTION)
155155
return 0;
156156
todo = min(len, sg_dma_len(sg));
157157
len -= todo;

0 commit comments

Comments
 (0)