]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - crypto/ahash.c
crypto: hash - Add import/export interface
[mv-sheeva.git] / crypto / ahash.c
index 27128f2c687a62494b8d20b60191c916376aca4a..7d4e33dfe2124379e63e303c5b722153e04e781c 100644 (file)
@@ -146,6 +146,20 @@ static int ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
        return ahash->setkey(tfm, key, keylen);
 }
 
+int crypto_ahash_import(struct ahash_request *req, const u8 *in)
+{
+       struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
+       struct ahash_alg *alg = crypto_ahash_alg(tfm);
+
+       memcpy(ahash_request_ctx(req), in, crypto_ahash_reqsize(tfm));
+
+       if (alg->reinit)
+               alg->reinit(req);
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(crypto_ahash_import);
+
 static unsigned int crypto_ahash_ctxsize(struct crypto_alg *alg, u32 type,
                                        u32 mask)
 {