Am Freitag, 24. April 2015, 07:21:05 schrieb Herbert Xu: Hi Herbert, >On Thu, Apr 23, 2015 at 03:42:19PM +0200, Stephan Mueller wrote: >> Now, shall I kind of re-implement the chainiv ablkcipher wrapper into an IV >> handler that just helps my code? That will be a lot of code for a simple >> memcmp. > >No no no. You don't need to do a template for givencrypt. chainiv >is a template because it can be used by any blkcipher. In your case >your fixed IV is only used by you. So just implement givencrypt and >givdecrypt directly in your blkcipher (or ablkcipher rather because >only ablkcipher supports givencrypt/givdecrypt). > >If you really want to keep the underlying kw as a blkcipher for the >sake of simplicity you could go back to the wrapper idea and have >the rfc wrapper around kw as an ablkcipher so that you can add the >givencrypt/givdecrypt calls. For the moment, I was working on the following approach: - kw() as blkcipher (like ctr() - implement a kwiv geniv handler and use it by kw via: inst->alg.cra_blkcipher.geniv = "kwiv"; So, if I read your recommendation right, I would do the following: - kw() as blkcipher (like the ctr()) - rfc3394() as ablkcipher around kw (like rfc3686()) I also have the givencrypt and givdecrypt functions. How would I directly hook them into the ablkcipher without using a reference for inst- >alg.cra_ablkcipher.geniv? Which approach would fit best? Ciao Stephan -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html