Re: Questions about ahash

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

 



Allyn, Mark A <mark.a.allyn@xxxxxxxxx> wrote:
> Folks:
> 
> I am attempting to implement an ahash instance for a hardware crypto device.
> 
> I see that there is a sha1 generic in the soruces a crypto/sha1_generic.c which uses the shash interface. I was hoping to use that, but there is some stuff in the headers that is confusing.

You should use shash only if your hardware is synchronous, e.g.,
the AESNI instruction is a good example where a synchronous
interface is appropriate.

The reason crypto_ahash is so different is because it should be
used where you need an asynchronous interface, where state has
to be stored indefinitely.

> There is a function shash_desc_ctx, but there is no function ahash_des_ctx. In the crys_sha1_init() function of sha1_generic, you call shash_desc_ctx. If I want to use the ahash instead of shash for sha1, then do I use shash_desc_ctx, or do I have to come up with my own ahash_desc_ctx?

The counterpart to shash_desc_ctx is ahash_request_ctx.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
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


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

  Powered by Linux