summaryrefslogtreecommitdiffhomepage
path: root/libtomcrypt/notes/tech0003.txt
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2006-03-08 13:23:58 +0000
committerMatt Johnston <matt@ucc.asn.au>2006-03-08 13:23:58 +0000
commit6ae3a09ef33b62811a7f60a1f97dcb89907c1ac1 (patch)
tree37e84722c5b30bbfc86947bee260473d4604b616 /libtomcrypt/notes/tech0003.txt
parent33defd1f9b6c4889fe5b075e6abb0b24c00f3a59 (diff)
parent8608a8e64c1aeda096867f43f89e29e1aee207ae (diff)
propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
to branch 'au.asn.ucc.matt.dropbear' (head fdf4a7a3b97ae5046139915de7e40399cceb2c01) --HG-- extra : convert_revision : dc4809882e1b9f2dcd3f8bbe38c74a0a52c39ce4
Diffstat (limited to 'libtomcrypt/notes/tech0003.txt')
-rw-r--r--libtomcrypt/notes/tech0003.txt52
1 files changed, 52 insertions, 0 deletions
diff --git a/libtomcrypt/notes/tech0003.txt b/libtomcrypt/notes/tech0003.txt
new file mode 100644
index 0000000..1a21867
--- /dev/null
+++ b/libtomcrypt/notes/tech0003.txt
@@ -0,0 +1,52 @@
+Tech Note 0003
+Minimizing Memory Usage
+Tom St Denis
+
+Introduction
+------------
+
+For the most part the library can get by with around 20KB of stack and about 32KB of heap even if you use the
+public key functions. If all you plan on using are the hashes and ciphers than only about 1KB of stack is required
+and no heap.
+
+To save space all of the symmetric key scheduled keys are stored in a union called "symmetric_key". This means the
+size of a symmetric_key is the size of the largest scheduled key. By removing the ciphers you don't use from
+the build you can minimize the size of this structure. For instance, by removing both Twofish and Blowfish the
+size reduces to 768 bytes from the 4,256 bytes it would have been (on a 32-bit platform). Or if you remove
+Blowfish and use Twofish with TWOFISH_SMALL defined its still 768 bytes. Even at its largest the structure is only
+4KB which is normally not a problem for any platform.
+
+
+Cipher Name | Size of scheduled key (bytes) |
+------------+-------------------------------|
+Twofish | 4,256 |
+Blowfish | 4,168 |
+3DES | 768 |
+SAFER+ | 532 |
+Serpent | 528 |
+Rijndael | 516 |
+XTEA | 256 |
+RC2 | 256 |
+DES | 256 |
+SAFER [#] | 217 |
+RC5 | 204 |
+Twofish [*] | 193 |
+RC6 | 176 |
+CAST5 | 132 |
+Noekeon | 32 |
+Skipjack | 10 |
+------------+-------------------------------/
+Memory used per cipher on a 32-bit platform.
+
+[*] For Twofish with TWOFISH_SMALL defined
+[#] For all 64-bit SAFER ciphers.
+
+Noekeon is a fairly fast cipher and uses very little memory. Ideally in low-ram platforms all other ciphers should be
+left undefined and Noekeon should remain. While Noekeon is generally considered a secure block cipher (it is insecure
+as a hash) CAST5 is perhaps a "runner-up" choice. CAST5 has been around longer (it is also known as CAST-128) and is
+fairly fast as well.
+
+You can easily accomplish this via the "config.pl" script. Simply answer "n" to all of the ciphers except the one you want
+and then rebuild the library. [or you can hand edit mycrypt_custom.h]
+
+