Why not just use the SHA1 only?
Posted Nov 18, 2008 4:30 UTC (Tue) by nevets (subscriber, #11875)
SHA-1 (as well as SHA-0) produces a 160-bit digest from a message with a maximum length of (2^64 − 1) bits
This looks like it can be much bigger than 128 bytes.
Posted Nov 18, 2008 16:01 UTC (Tue) by nix (subscriber, #2304)
Posted May 23, 2010 9:47 UTC (Sun) by rafal.maj (guest, #66508)
Posted May 23, 2010 10:57 UTC (Sun) by johill (subscriber, #25196)
+#define PAGECMP_OFFSET 128
+#define PAGEHASH_SIZE (PAGECMP_OFFSET ? PAGECMP_OFFSET : PAGE_SIZE)
+/* hash the page */
+static void page_hash(struct page *page, unsigned char *digest)
+ struct scatterlist sg;
+ struct hash_desc desc;
+ sg_init_table(&sg, 1);
+ sg_set_page(&sg, page, PAGEHASH_SIZE, 0);
+ desc.tfm = tfm;
+ desc.flags = 0;
+ crypto_hash_digest(&desc, &sg, PAGEHASH_SIZE, digest);
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds