2008-11-07 08:35:40

by Herbert Xu

[permalink] [raw]
Subject: [0/10] New crypto hash interface


The crc32c stuff finally tipped me over the edge into implementing
the often-talked about sync hash interface. Our hash interface
backend has always been targeted towards software implementations
in that it takes byte arrays instead of scatter lists. However,
the frontend has always been based on scatter lists.

Now that we have the ahash frontend for asynchronous users, there
is room for a synchronous interface that uses byte arrays only.
This is now implemented as shash.

Furthermore, the shash interface also supports the simultaneous
use of one tfm object by multiple threads, just like ahash. This
is accomplished by storing the hash state in a descriptor object
passed in by the user.

One immediate benefit is that we'll be able to remove the locking
that IPsec currently applies around the hash operation.

As it stands the shash backend coexists with the hash/digest backend
and algorithms implemented as shash will be available to the old
hash frontend, but not vice versa. The plan is to convert all
software hash algorithms to the new interface (starting with
crc32c), and then converting all hash/digest users to the new

Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt