[botan-devel] CRC32 intermediate state

Richard Huveneers richard at hekkihek.nl
Sun Jul 29 11:57:40 EDT 2012


Hi,

I use Botan in an iOS app (Disk Decipher, http://disk-decipher.hekkihek.nl),
feel free to add a ref to the Known Users page.

To support TrueCrypt key
files<http://www.truecrypt.org/docs/?s=keyfiles-technical-details>(step
7.c.i), the app needs access to the intermediate state. Since it
might be useful to others too, I attach the (almost trivial) patch below.

Also, I have made a few objects wrapping iOS's SHA functions into
subclasses of Botan::HashFunction. Since Botan does not have ARM assembly
versions, these are much (10x) faster than the default SHA implementation
provided by Botan. If anybody is interested, I'll gladly provide a zip file
containing the sources.

Regards, Richard.

*** src/checksum/crc32/crc32.h.orig     2012-06-17 20:50:48.000000000 +0200
--- src/checksum/crc32/crc32.h  2012-07-29 12:33:39.000000000 +0200
***************
*** 23,28 ****
--- 23,29 ----
        HashFunction* clone() const { return new CRC32; }

        void clear() { crc = 0xFFFFFFFF; }
+       void intermediate(byte[]);

        CRC32() { clear(); }
        ~CRC32() { clear(); }
*** src/checksum/crc32/crc32.cpp.orig   2012-06-17 20:50:48.000000000 +0200
--- src/checksum/crc32/crc32.cpp        2012-07-29 12:36:25.000000000 +0200
***************
*** 99,102 ****
--- 99,110 ----
     clear();
     }

+ /*
+ * Intermediate CRC32 Checksum
+ */
+ void CRC32::intermediate(byte output[])
+    {
+    store_be(crc, output);
+    }
+
  }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20120729/3de27a13/attachment.html>


More information about the botan-devel mailing list