skcipher and aead API question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Just browsing through include/crypto/skcipher.h and include/crypto/aead.h I noticed that
struct skcipher_alg and struct aead_alg define callbacks named 'init' and 'exit' as well as a
field called 'chunksize'. The inside-secure driver is currently initializing these fields to NULL
or 0 and that appears to work fine, but the respective heade files mention that all fields
should be filled in except for 'ivsize' ...

>From the code I deduce that init and exit are not called if they are null pointers, which is
fine for me as I have no need for such callbacks, but can I rely on that going forward?

I also deduce that if chunksize is set to 0, the chunksize will actually be taken from
cra_blocksize, which is at least fine for block ciphers. Again, can I rely on that?
If so, I guess I would  still have to set it for CTR modes which have cra_blocksize is 1?

Finally, I noticed that aead.h defines an additional callback 'setauthsize', which the
driver currently also keeps at NULL and that *seems* to work fine with all current
testmgr tests ... so I do wonder whether that is a must implement or not?
And if so, which subset of auth sizes MUST be implemented?

Regards,
Pascal van Leeuwen
Silicon IP Architect, Multi-Protocol Engines @ Verimatrix
www.insidesecure.com





[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux