Re: New Crypto Hardware

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

 



* Loc Ho | 2008-01-17 10:37:20 [-0800]:

>struct hash_alg {
>	int (*init)(struct hash_desc *desc);
>	int (*update)(struct hash_desc *desc, struct scatterlist *sg,
>		      unsigned int nbytes);
>	int (*final)(struct hash_desc *desc, u8 *out);
>	int (*digest)(struct hash_desc *desc, struct scatterlist *sg,
>		      unsigned int nbytes, u8 *out);
>	int (*setkey)(struct crypto_hash *tfm, const u8 *key,
>		      unsigned int keylen);
>
>	unsigned int digestsize;
>}; 
>
>It looks like update and final functions are used for continuous hashing.
>And digest function is used for single hashing. I was thing changing to this
>for async:
>
>struct ahash_alg {
>	int (*init)(struct ahash_request *req);
>	int (*digest)(struct ahash_request *req);
>	int (*setkey)(struct crypto_ahash *tfm, const u8 *key,
>		unsigned int keylen);
>
>	unsigned int digestsize;
>};
>
>But it seems like there is still a need to support continuation hashing as
>well as just single hash. 
>
>Questions:
>1. Is my assume about update/final and digest function correct? 
With update you do feed the digest/hash with new data. ->final writes
the result out. You can have 1+ update calls while you have only one
final call where you get your result. Does your HW create the digest in
one go and does not allow updates before creating the final result?

>2. What is the difference between digest and hash type besides one operation
>on transformation structure (tfm) and the other on descriptor (desc)? 
They are used for different things.
Digest is something like sha1 or md5. You just feed your algoritm with
data and get a single result. A hash on the other hand has a key which
is used as a salt, a random initialization string. 

>3. Currently, cryptodev-2.6 git doesn't work under PPC4xx development board
>but Denx linux latest works. Have anyone tested on PPC4xx board?

Please define doesn't work.

Sebastian
-
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