Ubuntu TrueCrypt Compilation

From PlugWiki

Jump to: navigation, search

TrueCrypt is not available as a package in Ubuntu 9.04 so it needs to be compiled from the sources. This page has the basic steps. There is, however, a problem on the Sheeva Plug: The gcc 4.3.3 for ARM that is shipped with Ubuntu 9.04 mis-compiles the RipeMD160 hash functions, leading to a test failure when calling 'truecrypt --test' in Volume/EncryptionTest.cpp, method TestPkcs5() which renders the binary unusable. The patch below fixes this particular problem:

--- Crypto/Rmd160.c.orig        2009-10-21 15:11:04.000000000 +0200
+++ Crypto/Rmd160.c     2009-10-24 21:01:09.000000000 +0200
@@ -91,7 +91,8 @@
 
                /* Process data in RIPEMD160_BLOCK_LENGTH-byte chunks. */
                while (len >= RIPEMD160_BLOCK_LENGTH) {
-                       RMD160Transform ((uint32 *) ctx->state, (const uint32 *) input);
+                       memcpy(ctx->buffer, input, RIPEMD160_BLOCK_LENGTH);
+                       RMD160Transform ((uint32 *) ctx->state, (const uint32 *) ctx->buffer);
                        input += RIPEMD160_BLOCK_LENGTH;
                        len -= RIPEMD160_BLOCK_LENGTH;
                }

Note: This patch applies cleanly to TrueCrypt 6.3 which was the current version at the time of this writing. The problem has been reported to the TrueCrypt developers, so a future version of either gcc or TrueCrypt might fix the problem.

Personal tools