LibTomCrypt is a well documented, public domain open source crypthographic
toolkit written in C. It supports lots of block ciphers (Blowfish, Twofish,
AES, XTEA, ...), chaining modes (ECB, CBC, OFB, CFB, CTR, ...), hash functions
(MD5, SHA-1, SHA-256, RIPE-MD, ...), HMAC mechanisms, pseudo-random number
generators and public key algorithms. It has several optimizations for the
i386, x86_64 and ppc32 architecture.