Skip to content

Commit

Permalink
crypto: ctr - Use chainiv on raw counter mode
Browse files Browse the repository at this point in the history
Raw counter mode only works with chainiv, which is no longer
the default IV generator on SMP machines.  This broke raw counter
mode as it can no longer instantiate as a givcipher.

This patch fixes it by always picking chainiv on raw counter
mode.  This is based on the diagnosis and a patch by Huang
Ying.

Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Aug 13, 2009
1 parent 73fec12 commit aef2713
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crypto/ctr.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ static struct crypto_instance *crypto_ctr_alloc(struct rtattr **tb)
inst->alg.cra_blkcipher.encrypt = crypto_ctr_crypt;
inst->alg.cra_blkcipher.decrypt = crypto_ctr_crypt;

inst->alg.cra_blkcipher.geniv = "chainiv";

out:
crypto_mod_put(alg);
return inst;
Expand Down

0 comments on commit aef2713

Please sign in to comment.