changes 83 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245
  1. April 19th, 2005
  2. v1.02
  3. -- Added LTC_TEST support to gcm_test()
  4. -- "pt/ct" can now be NULL in gcm_process() if you are processing zero bytes
  5. -- Optimized GCM by removing the "double copy" handling of the plaintext/aad
  6. -- Richard Outerbridge pointed out that x86_prof won't build on MACOS and that the manual
  7. erroneously refers to "mycrypt" all over the place. Fixed.
  8. April 17th, 2005
  9. v1.01
  10. ** Secure Science Corporation has supported this release cycle by sponsoring the development time taken. Their
  11. continuing support of this project has helped me maintain a steady pace in order to keep LibTomCrypt up to date,
  12. stable and more efficient.
  13. -----------------------------------------------------------------------------------------------------
  14. -- Updated base64_decode.c so if there are more than 3 '=' signs it would stop parsing
  15. -- Merged in latest mpi that fixed a few bugs here and there
  16. -- Updated OAEP encoder/decoder to catch when the hash output is too large
  17. Cleaned up PSS code too
  18. -- Andy Bontoft fixed a bug in my demos/tests/makefile.msvc ... seems "dsa_test.c" isn't an object
  19. afterall. Thanks.
  20. -- Made invalid ECC key sizes (configuration) not hard fault the program (it returns an error code now)
  21. -- SAFER has been re-enabled after I was pointed to http://www.ciphersbyritter.com/NEWS2/95032301.HTM
  22. [Mark Kotiaho]
  23. -- Added CCM mode to the encauth list (now has EAX, OCB and CCM, c'est un treo magnifique!)
  24. -- Added missing ASN.1 header to the RSA keys ... oops... now the rsa_export/import are FULLY compatible
  25. with other libs like OpenSSL (comment: Test vectors would go a long way RSA...)
  26. -- Manually merged in fix to the prime_random_ex() LTM function that ensures the 2nd MSB is set properly. Now
  27. When you say "I want a 1024/8 byte RSA key" the MSB bit of the modulus is set as expected. Note I generally
  28. don't view this as a "huge issue" but it's just one less nit to worry about. [Bryan Klisch]
  29. -- A new CVS has been setup on my Athlon64 box... if you want developer access send me an email (and at this point the email would have to be awesome).
  30. -- Updated API for ECB and CBC shell code. Now can process N whole blocks in one call (like $DEITY intended)
  31. -- Introduced a new "hardware accel" framework that can be used to speed up cipher ECB, CBC and CTR mode
  32. calls. Later on dependent code (e.g. OMAC, CCM) will be re-written to use the generic cbc/ctr functions. But now
  33. if you [say] call ctr_encrypt() with a cipher descriptor that has hardware CTR it will automatically
  34. be used (e.g. no code rewrites)
  35. -- Now ships with 20% more love.
  36. -- x86_prof now uses ECB shell code (hint: accelerators) and outputs cycles per BLOCK not byte. This will make it a bit
  37. easier to compare hardware vs. software cipher implementations. It also emits timings for CBC and CTR modes
  38. -- [Peter LaDow] fixed a typo w.r.t. XREALLOC macro (spelling counts kids!)
  39. -- Fixed bug with __x86_64__ where ROL64/ROR64 with LTC_NO_ROLC would be the 32-bit versions instead...
  40. -- Shipping with preliminary GCM code (disabled). It's buggy (stack overflow hidden somewhere). If anyone can spot it let me know.
  41. -- Added Pelican MAC [it's an AES based fast MAC] to the list of supported MACs
  42. -- Added LTC_FAST [and you can disable by defining LTC_NO_FAST] so that CBC and CTR mode XOR whole words [e.g. 32 or 64 bits] at a time
  43. instead of one byte. On my AMD64 this reduced the overhead for AES-128-CBC from 4.56 cycles/byte to around 1 cycle/byte. This requires
  44. that you either allow unaligned read/writes [e.g. x86_32/x86_64] or align all your data. It won't go out of it's way to ensure
  45. aligned access. Only enabled for x86_* platforms by default since they allow unaligned read/writes.
  46. -- Added LTC_FAST support to PMAC (drops the cycle/byte by about 9 cycles on my AMD64) [note: I later rewrote this prior to release]
  47. -- Updated "profiled" target to work with the new directory layout
  48. -- Added [demo only] optimized RC5-CTR code to x86_prof demo to show off how to make an accelerator
  49. [This has been removed prior to release... It may re-appear later]
  50. -- Added CCM acelerator callbacks to the list [now supports ECB, CTR, CBC and now CCM].
  51. -- Added chapter to manual about accelerators (you know you want it)
  52. -- Added "bswap" optimizations to x86 LOAD/STORE with big endian. Can be disabled by defining LTC_NO_BSWAP
  53. -- LTC_NO_ASM is now the official "disable all non-portable stuff" macro. When defined it will make the code endian-neutral,
  54. disable any form of ASM and disable LTC_FAST load/stores. Essentially build the library with this defined if you're having
  55. trouble building the library (old GCCs for instance dislike the ROLc macro)
  56. -- Added tomcrypt_mac.h and moved MAC/encMAC functions from tomcrypt_hash.h into it
  57. -- Added "done" function to ciphers and the five chaining modes [and things like omac/pmac/etc]
  58. -- Changed install group to "wheel" from "root".
  59. -- Replaced // comments with /**/ so it will build on older UNIX-like platforms
  60. -- x86_prof builds and runs with IntelCC fine now
  61. -- Added "stest" build to intel CC to test static linked from within the dir (so you don't have to install to test)
  62. -- Moved testing/benchmark into testprof directory and build it as part of the build. Now you can link against libtomcrypt_prof.a to get
  63. testing info (hint: hardware developers ;-) )
  64. -- Added CCM to tv_gen
  65. -- Added demos to MSVC makefile
  66. -- Removed -funroll-all-loops from GCC makefile and replaced with -funroll-loops which is a bit more sane (P4 ain't got much cache for the IDATA)
  67. -- Fixed GCM prior to release and re-enabled it. It has not been optimized but it does conform when compiled with optimizations.
  68. -- I've since optimized GCM and CCM. They're close in speed but GCM is more flexible imho (though EAX is more flexible than both)
  69. -- For kicks I optimized the ECC code to use projective points. Gets between 3.21x (Prescott P4) to 4.53x (AMD64) times faster than before at 160-bit keys and the
  70. speedup grows as the keysize grows. Basically removing most practical reasons to "not use the ECC code". Enjoy.
  71. -- Added LTC_FAST support to OMAC/PMAC and doubled it's speed on my amd64 [faster on the P4 too I guess]
  72. -- Added GCM to tv_gen
  73. -- Removed "makefile.cygwin_dll" as it's not really used by anyone and not worth the effort (hell I hardly maintain the MSVC makefiles ...)
  74. -- Updated a few files in the "misc" directory to have correct @file comments for doxygen
  75. -- Removed "profile" target since it was slower anyways (go figure...)
  76. December 31st, 2004
  77. v1.00
  78. -- Added "r,s == 0" check to dsa_verify_hash()
  79. -- Added "multi block" helpers for hash, hmac, pmac and omac routines so you can process multiple non-adjacent
  80. blocks of data with one call (added demos/multi.c to make sure they work)
  81. -- Note these are not documented but they do have doxygen comments inside them
  82. -- Also I don't use them in other functions (like pkcs_5_2()) because I didn't have the time. Job for the new LTC maintainer ;-)
  83. -- Added tweaked Anubis test vectors and made it default (undefined ANUBIS_TWEAK to get original Anubis)
  84. -- Merged in fix for mp_prime_random_ex() to deal with MSB and LSB "bugs"
  85. -- Removed tim_exptmod() completely, updated several RSA functions (notably v15 and the decrypt/verify) so they
  86. don't require a prng now
  87. -- This release brought to you by the fine tunes of Macy Gray. We miss you.
  88. December 23rd, 2004
  89. v1.00rc1
  90. -- Renamed "mycrypt_*" to "tomcrypt_*" to be more specific and professional
  91. Now just include "tomcrypt.h" instead of "mycrypt.h" to get LTC ;-)
  92. -- Cleaned up makefiles to ensure all headers are correctly installed
  93. -- Added "rotate by constant" macros for portable, x86-32 and x86-64
  94. You can disable this new code with LTC_NO_ROLC which is useful for older GCCs
  95. -- Cleaned up detection of x86-64 so it works for ROL/ROR macros
  96. -- Fixed rsa_import() so that it would detect multi-prime RSA keys and error appropriately
  97. -- Sorted the source files by category and updated the makefiles appropriately
  98. -- Added LTC_DER define so you can trim out DER code if not required
  99. -- Fixed up RSA's decrypt functions changing "res" to "stat" to be more in sync
  100. with the signature variables nomenclature. (no code change just renamed the arguments)
  101. -- Removed all labels starting with __ and replaced with LBL_ to avoid namespace conflicts (Randy Howard)
  102. -- Merged in LTM fix to mp_prime_random_ex() which zap'ed the most significant byte if the bit size
  103. requested was a multiple of eight.
  104. -- Made RSA_TIMING off by default as it's not terribly useful [and likely to be deprecated]
  105. -- Renamed SMALL_CODE, CLEAN_STACK and NO_FILE to have a LTC_ prefix to avoid namespace collisions
  106. with other programs. e.g. SMALL_CODE => LTC_SMALL_CODE
  107. -- Zed Shaw pointed out that on certain systems installing libs as "root" isn't possible as the super-user
  108. is not root. Now the makefiles allow this to be changed easily.
  109. -- Renamed "struct _*_descriptor" to "struct ltc_*_descriptor" to avoid using a leading _
  110. Also renamed _ARGCHK to LTC_ARGCHK
  111. -- Zed Shaw pointed out that I still defined the prng structs in tomcrypt_prng.h even if they
  112. weren't defined. This made undef'ing FORTUNA break the build.
  113. -- Added LTC_NO_ASM to disable inline asm macros [ROL/ROR/etc]
  114. -- Changed RSA decrypt functions to change the output length variable name from "keylen" to "outlen" to make
  115. it more consistent.
  116. -- Added the 64-bit Khazad block cipher [NESSIE]
  117. -- Added the 128-bit Anubis block cipher [with key support for 128...320 bit keys] [NESSIE]
  118. -- Changes to several MAC functions to rename input arguments to more sensible names
  119. -- Removed FAST_PK support from dh_sys.c
  120. -- Declared deskey() from des.c as static instead of a global
  121. -- Added pretty much all practical GCC warning tests to the GCC [related] makefiles. These additional
  122. warnings can easily be disabled for those with older copies of GCC [or even non GNU cc's]
  123. -- Added doxygen @ tags to the code... phew that was a hell of a lot of [repetitive] work
  124. -- Also added pre-configured Doxygen script.
  125. -- Cleaned up quite a few functions [ciphers, pk, etc] to make the parameters naming style consistent
  126. E.g. ciphers keys are called "skey" consistently now. The input to PK encryption is called "in", etc.
  127. These changes require no code changes on the behalf of developers fortunately
  128. -- Started a SAFER+ optimizer [does encrypt only] which shaves a good 30 or so cycles/byte on my AMD64
  129. at an expense of huge code. It's in notes/etc/saferp_optimizer.c
  130. -- DSA sign/verify now uses DER encoded output/inputs and no LTC style headers.
  131. -- Matt Johnston found a missing semi-colon in mp_exptmod(). Fix has been merged in.
  132. October 29th, 2004
  133. v0.99 -- Merged in the latest version of LTM which includes all of the recent bug fixes
  134. -- Deprecated LTMSSE and removed it (to be replaced with TFM later on)
  135. -- Stefan Arentz pointed out that mp_s_rmap should be extern
  136. -- Kristian Gjøsteen pointed out that there are typos in the
  137. "test" makefile and minor issues in Yarrow and Sober [just cosmetics really]
  138. -- Matthew P. Cashdollar pointed out that "export" is a C++ keyword
  139. so changed the PRNG api to use "pexport" and "pimport"
  140. -- Updated "hashsum" demo so it builds ;-)
  141. -- Added automatic support for x86-64 (will configure for 64-bit little endian automagically)
  142. -- Zhi Chen pointed out a bug in rsa_exptmod which would leak memory on error.
  143. -- Made hash functions "init" return an int. slight change to API ;-(
  144. -- Added "CHC" mode which turns any cipher into a hash the other LTC functions can use
  145. -- Added CHC mode stuff to demos such as tv_gen and hashsum
  146. -- Added "makefile.shared" which builds and installs shared/static object copies
  147. of the library.
  148. -- Added DER for bignum support
  149. -- RSA is now fully joy. rsa_export/rsa_import use PKCS #1 encodings and should be
  150. compatible with other crypto libs that use the format.
  151. -- Added support for x86-64 for the ROL/ROR macros
  152. -- Changed the DLL and SO makefiles to optimize for speed, commented SMALL_CODE in
  153. mycrypt_custom.h and added -DSMALL_CODE to the default makefile
  154. -- Updated primality testing code so it does a minimum of 5 tests [of Miller-Rabin]
  155. (AFAIK not a security fix, just warm fuzzies)
  156. -- Minor updates to the OMAC code (additional __ARGCHK and removed printf from omac_test... oops!)
  157. -- Update build and configuration info which was really really really out of date. (Chapter 14)
  158. ++ Minor update, switch RSA to use the PKCS style CRT
  159. August 6th, 2004
  160. v0.98 -- Update to hmac_init to free all allocated memory on error
  161. -- Update to PRNG API to fix import/export functions of Fortuna and Yarrow
  162. -- Added test functions to PRNG api, RC4 now conforms ;-) [was a minor issue]
  163. -- Added the SOBER-128 PRNG based off of code donated by Greg Rose.
  164. -- Added Tech Note #4 [notes/tech0004.txt]
  165. -- Changed RC4 back [due to request]. It will now XOR the output so you can use it like
  166. a stream cipher easily.
  167. -- Update Fortuna's export() to emit a hash of each pool. This means that the accumulated
  168. entropy that was spread over all the pools isn't entirely lost when you export/import.
  169. -- Zhi Chen suggested a comment for rsa_encrypt_key() to let users know [easily] that it was
  170. PKCS #1 v2.0 padding. (updated other rsa_* functions)
  171. -- Cleaned up Noekeon to remove unrolling [wasn't required, was messy and actually slower with GCC/ICC]
  172. -- Updated RC4 so that when you feed it >256 bytes of entropy it quietly ignores additional
  173. bytes. Also removed the % from the key setup to speed it up a bit.
  174. -- Added cipher/hash/prng tests to x86_prof to help catch bugs while testing
  175. -- Made the PRNG "done" return int, fixed sprng_done to not require prng* to be non-null
  176. -- Spruced up mycrypt_custom.h to trap more errors and also help prevent LTMSSE from being defined
  177. on non-i386 platforms by accident.
  178. -- Added RSA/ECC/DH speed tests to x86_prof and cleaned it up to build with zero warnings
  179. -- Changed Fortuna to count only entropy [not the 2 byte header] added to pool[0] into the
  180. reseed mechanism.
  181. -- Added "export_size" member to prng_descriptor tables so you can know in advance the size of
  182. the exported state for any given PRNG.
  183. -- Ported over patch on LTM 0.30 [not ready to release LTM 0.31] that fixes bug in mp_mul()/mp_div()
  184. that used to result in negative zeroes when you multiplied zero by a negative integer.
  185. (patch due to "Wolfgang Ehrhardt" <[email protected]>)
  186. -- Fixed rsa_*decrypt_key() and rsa_*verify_hash() to default to invalid "stat" or "res". This way
  187. if any of the higher level functions fail [before you get to the padding] the result will be in
  188. a known state]. Applied to both v2 and v1.5 padding helpers.
  189. -- Added MACs to x86_prof
  190. -- Fixed up "warnings" in x86_prof and tv_gen
  191. -- Added a "profiled" target back [for GCC 3.4 and ICC v8]. Doesn't seem to help but might be worth
  192. tinkering with.
  193. -- Beefed up load/store test in demos/test
  194. ++ New note, in order to use the optimized LOAD/STORE macros your platform
  195. must support unaligned 32/64 bit load/stores. The x86s support this
  196. but some [ARM for instance] do not. If your platform cannot perform
  197. unaligned operations you must use the endian neutral code which is safe for
  198. any sort of platform.
  199. July 23rd, 2004
  200. v0.97b -- Added PKCS #1 v1.5 RSA encrypt/sign helpers (like rsa_sign_hash, etc...)
  201. -- Added missing prng check to rsa_decrypt_key() [not critical as I don't use
  202. descriptors directly in that function]
  203. -- Merged in LTM-SSE, define LTMSSE before you build and you will get SSE2 optimized math ;-)
  204. (roughly 3x faster on a P4 Northwood). By default it will compile as ISO C portable
  205. code (when LTMSSE is undefined).
  206. -- Fixed bug in ltc_tommath.h where I had the kara/toom cutoffs not marked as ``extern''
  207. Thanks to "Stefan Arentz" <stefan at organicnetwork.net>
  208. -- Steven Dake <[email protected]> and Richard Amacker <[email protected]> submitted patches to
  209. fix pkcs_5_2(). It now matches the output of another crypto library. Whoops... hehehe
  210. -- Updated PRNG api. Added Fortuna PRNG to the list of supported PRNGs
  211. -- Fixed up the descriptor tables since globals are automatically zero'ed on startup.
  212. -- Changed RC4 to store it's output. If you want to encrypt with RC4
  213. you'll have to do the XOR yourself.
  214. -- Fixed buffer overflows/overruns in the HMAC code.
  215. ++ API change for the PRNGs there now is a done() function per PRNG. You
  216. should call it when you are done with a prng state. So far it's
  217. not absolutely required (won't cause problems) but is a good idea to
  218. start.
  219. June 23rd, 2004
  220. v0.97a ++ Fixed several potentially crippling bugs... [read on]
  221. -- Fixed bug in OAEP decoder that would incorrectly report
  222. buffer overflows. [Zhi Chen]
  223. -- Fixed headers which had various C++ missing [extern "C"]'s
  224. -- Added "extern" to sha384_desc descriptor which I removed by mistake
  225. -- Fixed bugs in ENDIAN_BIG macros using the wrong byte order [Matt Johnston]
  226. -- Updated tiger.c and des.c to not shadow "round" which is intrinsic on
  227. some C compilers.
  228. -- Updated demos/test/rsa_test.c to test the RSA functionality better
  229. ++ This update has been tested with GCC [v3.3.3], ICC [v8] and MSVC [v6+SP6]
  230. all on a x86 P4 [GCC/ICC tested in Gentoo Linux, MSVC in WinXP]
  231. ++ Outcome: The bug Zhi Chen pointed out has been fixed. So have the bugs
  232. that Matt Johnston found.
  233. June 19th, 2004
  234. v0.97 -- Removed spurious unused files [arrg!]
  235. -- Patched buffer overflow in tim_exptmod()
  236. -- Fixed buffer overrun bug in pkcs_1_v15_es_decode()
  237. -- Reduced stack usage in PKCS #1 v2.0 padding functions (by several KBs)
  238. -- Removed useless extern's that were an artifact from the project start... ;-)
  239. -- Replaced memcpy/memset with XMEMCPY and XMEMSET for greater flexibility
  240. -- fixed bugs in hmac_done()/hmac_init()/[various others()] where I didn't trap errors
  241. -- Reduced stack usage in OMAC/PMAC/HMAC/EAX/OCB/PKCS#5 by mallocing any significant sized
  242. arrays (e.g. > 100 bytes or so). Only in non-critical functions (e.g. eax_init())
  243. -- "Zhi Chen" <[email protected]> pointed out that rsa_decrypt_key() requires
  244. an incorrect output size (too large). Fixed.
  245. -- Added a "pretty" target to the GCC makefile. Requires PERL. It is NEAT!
  246. -- Minor updates to ch1 of the manual.
  247. -- Cleaned up the indentation and added comments to rsa_make_key(), rsa_exptmod() and
  248. rsa_verify_hash()
  249. -- Updated makefile.icc so the "install" target would work ;-)
  250. -- Removed demos/test.c [deprecated from demos/test/test.c]
  251. -- Changed MAXBLOCKSIZE from 128 to 64 to reflect the true size...
  252. May 30th, 2004
  253. v0.96 -- Removed GF and Keyring code
  254. -- Extended OAEP decoder to distinguish better [and use a more uniform API]
  255. -- Changed PSS/OAEP API slightly to be more consistent with other PK functions (order of arguments)
  256. -- rsa_exptmod() now pads with leading zeroes as per I2OSP.
  257. -- added error checking to yarrow code
  258. -- pointed out that tommath.h from this distro will overwrite tommath.h
  259. from libtommath. I changed this to ltc_tommath.h to avoid any such problems.
  260. -- Fixed bug in PSS encoder/decoder that didn't handle the MSB properly
  261. -- refactored AES, now sports an "encrypt only" descriptor which uses half as much code space.
  262. -- modded Yarrow to try and use refactored AES code and added WHIRLPOOL support (d'oh) ;-)
  263. -- updated ECB, OCB and CBC decrypt functions to detect when "encrypt only" descriptor is used.
  264. -- replaced old RSA code with new code that uses PKCS #1 v2.0 padding
  265. -- replaced old test harness with new over-engineer'ed one in /demos/test/
  266. -- updated cbc/cfb/ofb/ctr code with setiv/getiv functions to change/read the IV without re-keying.
  267. -- Added PKCS #1 v1.5 RSA encryption and signature padding routines
  268. -- Added DER OID's to most hash descriptors (as many as I could find)
  269. -- modded rsa_exptmod() to use timing-resilient tim_exptmod() when doing private key operations
  270. added #define RSA_TIMING which can turn on/off this feature.
  271. -- No more config.pl so please just read mycrypt_custom.h for build-time tweaks
  272. -- Small update to rand_prime()
  273. -- Updated sha1, md5 and sha256 so they are smaller when SMALL_CODE is defined. If you want speed though,
  274. you're going to have to undefine SMALL_CODE ;-)
  275. -- Worked over AES so that it's even smaller now [in both modes].
  276. May 12th, 2004
  277. v0.95 -- Optimized AES and WHIRLPOOL for SMALL_CODE by taking advantage of the fact
  278. the transforms are circulant. AES dropped 5KB and WHIRLPOOL dropped 13KB
  279. using the default build options on the x86.
  280. -- Updated eax so the eax_done() would clear the state [like hmac,pmac,ocb] when
  281. CLEAN_STACK has been defined.
  282. -- added LTC_TEST support to rmd160
  283. -- updates to mycrypt_pk.h
  284. -- updated rand_prime() to faciliate making RSA composites
  285. -- DSA/RSA now makes composites of the exact size desired.
  286. -- Refactored quite a bit of the code, fewer functions per C file
  287. -- cleaned up the makefiles to organize the objects logically
  288. -- added ICC makefile along with "profiled" targets for both GNU and ICC compilers
  289. -- Marked functions for removal before v1.00 see PLAN for more information
  290. -- GCC 3.4.0 tested and seems to work
  291. -- Added PKCS #5 support
  292. -- Fixed typo in comment header of .C files ;-)
  293. -- Added PKCS #1 OAEP and PSS support.
  294. Feb 20th, 2004
  295. v0.94 -- removed unused variables from ocb.c and fixed it to match known test vectors.
  296. -- Added PMAC support, minor changes to OMAC/EAX code [I think....]
  297. -- Teamed up with Brian Gladman. His code verifies against my vectors and my code
  298. verifies against his test vectors. Hazaa for co-operation!
  299. -- Various small changes (added missing ARGCHKs and cleaned up indentation)
  300. -- Optimization to base64, removed unused variable "c"
  301. -- Added base64 gen to demos/tv_gen.c
  302. -- Fix to demos/x86_prof.c to correctly identify the i386 architecture... weird...
  303. -- Fixed up all of the PK code by adding missing error checking, removed "res" variables,
  304. shrunk some stack variables, removed non-required stack variables and added proper
  305. error conversion from MPI to LTC codes. I also spotted a few "off by one" error
  306. checking which could have been used to force the code to read past the end of
  307. the buffer (in theory, haven't checked if it would work) by a few bytes.
  308. -- Added checks to OUTPUT_BIGNUM so the *_export() functions cannot overflow the output and I
  309. also modded it so it stores in the output provided to the function (that is not on
  310. the local stack) which saves memory and time.
  311. -- Made SAFER default to disabled for now (plans are to cleanhouse write an implementation later)
  312. -- Added the 512-bit one-way hash WHIRLPOOL which clocks in at 138 cycles per byte on my
  313. Athlon XP [for comparison, SHA-512 clocks in at 77 cycles per byte]. This code uses the
  314. teams new sbox design (not the original NESSIE one).
  315. Jan 25th, 2004
  316. v0.93 -- [note: deleted v0.93 changes by accident... recreating from memory...]
  317. -- Fix to RC2 to not deference pointer before ARGCHK
  318. -- Fix to NOEKEON to match published test vectors as well as cleaned up the code a bit
  319. -- Optimized Twofish [down to 28 cycles/byte on my box] and Blowfish
  320. -- Fix to OMAC to test cipher block size first [prevents wasting any time]
  321. -- Added more OMAC test vectors
  322. -- Added EAX Encrypt+Authenticate support
  323. -- Fix to DSA to check return of a few LTM functions I forgot [mp_to_unsigned_bin]
  324. -- Added common headers to all C files
  325. -- CTR mode supports big and little [default] endian counters now.
  326. -- fix to find_cipher_any() so that it can handle a fragmented cipher_descriptor table.
  327. -- added find_hash_any() akin to find_cipher_any().
  328. -- Added EAX code to demos/tv_gen.c Hazaa!
  329. -- Removed SONY defines and files from codebase.
  330. -- Added OCB support [patents be damned] and to demos/tv_gen.c
  331. -- Merge all of the INPUT/OUTPUT BIGNUM macros (less toc) into mycrypt_pk.h
  332. -- Made appropriate changes to the debug string in crypt.c
  333. Dec 24th, 2003
  334. v0.92 -- Updated the config.pl script so the options have more details.
  335. -- Updated demos/tv_gen to include RIPEMD hashes
  336. -- Updated Twofish so when TWOFISH_ALL_TABLES is defined a pre-computed RS table
  337. is included [speedup: slight, about 4k cycles on my Athlon].
  338. -- Re-wrote the twofish large key generation [the four 8x32 key dependent tables]. Now about twice as fast.
  339. With both optimizations [e.g. TWOFISH_ALL_TABLES defined] a 128-bit Twofish key can now be scheduled
  340. in 26,000 cycles on my Athlon XP [as opposed to 49,000 before] when optimized for size.
  341. -- config.pl has been updated so rmd128.o and rmd160.o are objects included in the build [oops]
  342. -- Andrew Mann found a bug in rsa_exptmod() which wouldn't indicate if the wrong type of key was specified
  343. (e.g. not PK_PRIVATE or PK_PUBLIC)
  344. -- Fixed up demos/x86_prof so it sorts the output now :-)
  345. -- The project is now powered by radioactive rubber pants.
  346. -- Fixed dh_encrypt_key() so if you pass it a hash with a smaller output than the input key it
  347. will return CRYPT_INVALID_HASH [to match what ecc_encrypt_key() will do]
  348. -- Merge the store/encrypt key part of ecc_encrypt_key() as per dh_encrypt_key() [can you guess what I'm upto?]
  349. -- Massive updates to the prime generation code. I use the LTM random prime functions [and provide a nice
  350. interface between the LTC PRNG's and the LTM generic prng prototype]. I also use a variable number of tests
  351. depending on the input size. This nicely speeds up most prime generation/testing within the library.
  352. -- Added SHA-224 to the list of hashes.
  353. -- Made HMAC test vectors constant and static [takes ROM space instead of RAM]
  354. -- This release was brought to you by the letter P which stands for Patent Infringement.
  355. -- Added generic HASH_PROCESS macro to mycrypt_hash.h which simplifies the hash "process" functions
  356. I also optimized the compression functions of all but MD2 to not perform input copies when avoidable.
  357. -- Removed the division from the Blowfish setup function [dropped 3k cycles on my Athlon]
  358. -- Added stack cleaning to rijndael, cast5 so now all ciphers have CLEAN_STACK code.
  359. -- Added Skipjack to the list of ciphers [made appropriate changes to demos/test.c, demos/tv_gen.c and
  360. demos/x86_prof.c]
  361. -- Added mechanical testing to cipher test vector routines. Now it encrypts 1000 times, then decrypts and
  362. compares. Any fault (e.g. bug in code, compiler) in the routines is likely to show through. Doesn't
  363. stress test the key gen though...
  364. -- Matt Johnson found a bug in the blowfish.c apparently I was out of my mind and put twofish defines in there
  365. The code now builds with any config. Thanks.
  366. -- Added OMAC1 Message Authentication Code support to the library.
  367. -- Re-prototyped the hash "process" and "done" to prevent buffer overflows [which don't seem easy to exploit].
  368. Updated HMAC code to use them too. Hazaa!
  369. -- Fixed bug in ECC code which wouldn't do an _ARGCHK on stat in ecc_verify_hash().
  370. -- Fixed [temp fix] bug in all PK where the OUTPUT_BIGNUM macros would not trap errors on the to_unsigned_bin
  371. conversion [now returns CRYPT_MEM, will fix it up better later]
  372. -- Added DSA to the list of supported PK algorithms.
  373. -- Fixed up various ciphers to &255 the input key bytes where required [e.g. where used to index a table] to prevent
  374. problems on platforms where CHAR_BIT != 8
  375. -- Merged in LibTomMath v0.28
  376. -- Updated demos/x86_prof.c to use Yarrow during the key sched testing [was horribly slow on platforms with blockable
  377. /dev/random].
  378. -- Added OMAC/HMAC tests to demos/tv_gen and I now store the output of this in notes/
  379. -- Fixed a bug in config.pl that wouldn't have TWOFISH_TABLES defined by default (too many commas on the line)
  380. -- Fixed bug in hmac_done(). Apparently FIPS-198 [HMAC] specifies that the output can be truncated. My code
  381. would not support that (does now just like the new OMAC code).
  382. -- Removed "hashsize" from hmac_state as it wasn't being used.
  383. -- Made demos/test.c stop if OMAC or HMAC tests fail (instead of just printing a failed message and keep going).
  384. -- Updated notes/tech0003.txt to take into account the existence of Skipjack [also I fixed a few typos].
  385. -- Slight changes to Noekeon, with SMALL_CODE undefined it uses a fully unrolled version. Dropped +10 cycles/byte
  386. on my Athlon (35 cycles per byte or 410.4Mbit/sec at 1795Mhz)
  387. -- Added _ARGCHK() calls to is_prime() for the two input pointers.
  388. Sept 25th, 2003
  389. v0.91 -- HMAC fix of 0.90 was incorrect for keys larger than the block size of the hash.
  390. -- Added error CRYPT_FILE_NOTFOUND for the file [hmac/hash] routines.
  391. -- Added RIPEMD hashes to the hashsum demo.
  392. -- Added hashsum demo to MSVC makefile.
  393. -- Added RMD160 to the x86_prof demo [oops]
  394. -- Merged in LibTomMath-0.27 with a patch to mp_shrink() that will be in LibTomMath-0.28
  395. Fixes another potential memory leak.
  396. Sept 7th, 2003
  397. v0.90 -- new ROL/ROR for x86 GCC
  398. -- Jochen Katz submitted a patch to the makefile to prevent "make" from making the .a library
  399. when not required.
  400. == By default the KR code is not enabled [it's only a demo anyways!]
  401. -- changed the "buf" in ecc_make_key from 4KB to 128 bytes [since the largest key is 65 bytes]
  402. -- hmac_done() now requires you pass it the size of the destination buffer to prevent
  403. buffer overflows. (API CHANGE)
  404. -- hmac/hash filebased routines now return CRYPT_NOP if NO_FILE is defined.
  405. -- I've removed the primes from dh.c and replaced them with DR safe primes suitable for the default
  406. configuration of LibTomMath. Check out these comparisons on a 1.3Ghz Athlon XP, optimized for size,
  407. 768-bit, 4 vs. 10
  408. 1024-bit, 8 vs. 18
  409. 1280-bit, 12 vs. 34
  410. 1536-bit, 20 vs. 56
  411. 1792-bit 28 vs. 88
  412. 2048-bit, 40 vs. 124
  413. 2560-bit, 71 vs. 234
  414. 3072-bit, 113 vs. 386
  415. 4096-bit, 283 vs. 916
  416. Times are all in milliseconds for key generation. New primes times on the left. This makes the code binary
  417. incompatible with previous releases. However, this addition is long overdue as LibTomMath has supported DR
  418. reductions for quite some time.
  419. -- Added RIPE-MD 128 and 160 to the list of supported hashes [10 in total].
  420. -- The project has been released as public domain. TDCAL no longer applies.
  421. July 15th, 2003
  422. v0.89 -- Fix a bug in bits.c which would prevent it from building with msvc
  423. -- Merged in LibTomMath v0.24 [and I used the alloc/free macros this time!]
  424. -- Removed the LTC version of next_prime() and replaced it with a call to the
  425. mp_prime_next_prime() from LibTomMath
  426. -- reverted bits.c to the 0.86 copy since the new one doesn't build in MSVC
  427. or cygwin.
  428. Jul 10th, 2003
  429. v0.88 -- Sped up CAST5 key schedule for MSVC
  430. -- added "ulong32" which allows people on 64-bit platforms to force the 32-bit tables in
  431. ciphers like blowfish and AES to be 32-bits. E.g. when unsigned long is 64-bits.
  432. -- Optimized the SAFER-SK64, SAFER-SK128, SAFER+, RC5 and RC6 key schedule [big time!]
  433. -- Optimized SHA-1 and SHA-256 quite a bit too.
  434. -- Fixed up the makefile to use -fomit-frame-pointer more liberally
  435. -- Added tv_gen program which makes test vectors for ciphers/hashes
  436. -- Merged in LibTomMath v0.22
  437. Jun 19th, 2003
  438. v0.87 -- Many MSVC optimizations to the code base
  439. -- Improved the AES and Twofish key schedule [faster, more constant time]
  440. -- Tons of optimizations here and there.
  441. Jun 15th, 2003
  442. v0.86 -- Fixed up AES to workaround MSVC optimizer bug
  443. -- Merged in fresh LTM base [based on v0.20] so there are no warnings with MSVC
  444. -- Wrote x86_prof which will time the hashes and ciphers downto cycles per byte.
  445. -- Fixed up demos/encrypt to remove serpent_desc from the list
  446. -- Re-enabled MSVC optimizations w00t w00t
  447. -- Replaced "errno" with "err" in all functions that had it so it wouldn't clash
  448. with the global "errno"
  449. -- Removed a set of unused variables from certain functions
  450. -- Removed {#line 0 "..."} stuff from mpi.c to comply with ISO C :-)
  451. Jun 11th, 2003
  452. v0.85 -- Swapped in a new AES routine
  453. -- Removed Serpent
  454. -- Added TDCAL policy document
  455. Jun 1st, 2003
  456. v0.84 -- Removed a 4KB buffer from rsa_decrypt_key that wasn't being used no more
  457. -- Fixed another potential buffer problem. Not an overflow but could cause the
  458. PK import routines to read past the end of the buffer.
  459. -- Optimized the ECC mulmod more by removing a if condition that will always be false
  460. -- Optimized prime.c to not include a 2nd prime table, removed code from is_prime calls prime
  461. test from LibTomMath now
  462. -- Added LTC_TEST define which when defined will enable the test vector routines [see mycrypt_custom.h]
  463. -- Removed ampi.o from the depends cuz it ain't no not working in *nix with it [routines are in mpi.c now].
  464. Mar 29th, 2003
  465. v0.83 -- Optimized the ecc_mulmod, it's faster and takes less heap/stack space
  466. -- Fixed a free memory error in ecc_mulmod and del_point which would try to free NULL
  467. -- Fixed two serious bugs in rsa_decrypt_key and rsa_verify_hash that would allow a trivialy
  468. buffer overflow.
  469. -- Fixed a bug in the hmac testing code if you don't register all the hashes it won't return
  470. errors now.
  471. Mar 15th, 2003
  472. v0.82 -- Manual updated
  473. -- Added MSVC makefile [back, actually its written from scratch to work with NMAKE]
  474. -- Change to HMAC helper functions API to avoid buffer overflow [source changes]
  475. -- the rsa_encrypt_key was supposed to reject key sizes out of bounds ...
  476. same fix to the rsa_sign_hash
  477. -- Added code to ensure that that chaining mode code (cfb/ofb/ctr/cbc) have valid
  478. structures when being called. E.g. the indexes to the pad/ivs are not out of bounds
  479. -- Cleaned up the DES code and simplified the core desfunc routine.
  480. -- Simplified one of the boolean functions in MD4
  481. Jan 16th, 2003
  482. v0.81 -- Merged in new makefile from Clay Culver and Mike Frysinger
  483. -- Sped up the ECC mulmod() routine by making the word size adapt to the input. Saves a whopping 9 point
  484. operations on 521-bit keys now (translates to about 8ms on my Athlon XP). I also now use barrett reduction
  485. as much as possible. This sped the routine up quite a bit.
  486. -- Fixed a huge flaw in ecc_verify_hash() where it would return CRYPT_OK on error... Now fixed.
  487. -- Fixed up config.pl by fixing an invalid query and the file is saved in non-windows [e.g. not CR/LF] format
  488. (fix due to Mika Boström)
  489. -- Merged in LibTomMath for kicks
  490. -- Changed the build process so that by default "mycrypt_custom.h" is included and provided
  491. The makefile doesn't include any build options anymore
  492. -- Removed the PS2 and VC makefiles.
  493. Dec 16th, 2002
  494. v0.80 -- Found a change I made to the MPI that is questionable. Not quite a bug but definately not desired. Had todo
  495. with the digit shifting. In v0.79 I simply truncated without zeroing. It didn't cause problems during my
  496. testing but I fixed it up none the less.
  497. -- Optimized s_mp_mul_dig() from MPI to do a minimal number of passes.
  498. -- Fixed in rsa_exptmod() where I was getting the size of the result. Basically it accomplishes the same thing
  499. but the fixed code is more readable.
  500. -- Fixed slight bug in dh_sign_hash() where the random "k" value was 1 byte shorter than it should have been. I've
  501. also made the #define FAST_PK speed up signatures as well. Essentially FAST_PK tells the DH sub-system to
  502. limit any private exponent to 256-bits. Note that when FAST_PK is defined does not make the library
  503. binary or source incompatible with a copy of the library with it undefined.
  504. -- Removed the DSA code. If you want fast diffie-hellman just define FAST_PK :-)
  505. -- Updated dh_sign_hash()/dh_verify_hash() to export "unsigned" bignums. Saves two bytes but is not binary
  506. compatible with the previous release... sorry! I've performed the same fix to the ecc code as well.
  507. -- Fixed up the PK code to remove all use of mp_toraw() and mp_read_raw() [get all the changes out of the way now]
  508. -- Fixed a bug in the DH code where it missed trapping a few errors if they occurred.
  509. -- Fixed a slight "its-not-a-bug-but-could-be-done-better" bug in the next_prime() function. Essentially it was
  510. testing to ensure that in the loop that searches for the next candidate that the step never grows beyond
  511. 65000. Should have been testing for MP_DIGIT_MAX
  512. -- Spruced up the config.pl script. It now makes a header file "mycrypt_custom.h" which can be included *before*
  513. you include mycrypt.h. This allows you to add libtomcrypt to a project without completely changing your make
  514. system around. Note that you should use the makefile it writes to at least build the library initially.
  515. -- Used splint to check alot of the code out. Tons of minor fixes and explicit casts added.
  516. -- Also made all the internal functions of MPI are now static to avoid poluting the namespace
  517. -- **Notice**: There are no planned future releases for at least a month from the this release date.
  518. Dec 14th, 2002
  519. v0.79 -- Change to PK code [binary and source]. I made it so you have to pass the buffer size to the *_decrypt_key and
  520. *_verify_hash functions. This prevents malformed packets from performing buffer overflows. I've also trimmed
  521. the packet header size [by 4 bytes].
  522. -- Made the test program halt on the first error it occurs. Also made it trap more errors than before.
  523. -- Wrote the first chapter of my new book [DRAFT!], not in this package but check my website!
  524. -- Included a perl script "config.pl" that will make "makefile.out" according to the users needs.
  525. -- Added shell script to look for latest release
  526. -- Merge DH and ECC key defines from mycrypt_cfg.h into the makefiles
  527. -- updated the makefile to use BSD friendly archiving invokations
  528. -- Changed the DH and ECC code to use base64 static key settings [e.g. the primes]. Dropped the code size by 3KB
  529. and is ever-so-slightly faster than before.
  530. -- added "mp_shrink" function to shrink the size of bignums. Specially useful for PK code :-)
  531. -- Added new exptmod function that calculates a^b mod c with fewer multiplies then before [~20% for crypto
  532. sized numbers]. Also added a "low mem" variant that doesn't use more than 20KB [upto 4096 bit nums] of
  533. heap todo the calculation. Both are #define'able controlled
  534. -- Added XREALLOC macro to provide realloc() functionality.
  535. -- Added fix where in rsa_import() if you imported a public key or a non-optimized key it would free the mp_int's
  536. not being used.
  537. -- Fixed potential bug in the ECC code. Only would occur on platforms where char is not eight bits [which isn't
  538. often!]
  539. -- Fixed up the ECC point multiplication, its about 15% faster now
  540. -- While I was at it [since the lib isn't binary backwards compatible anyways] I've fixed the PK export routines
  541. so they export as "unsigned" types saving 1 byte per bignum outputted. Not a lot but heck why not.
  542. Nov 28th, 2002
  543. v0.78 -- Made the default ARGCHK macro a function call instead which reduced the code size from 264KB to 239KB.
  544. -- Fixed a bug in the XTEA keysize function which called ARGCHK incorrectly.
  545. -- Added Noekeon block cipher at 2,800 bytes of object code and 345Mbit/sec it is a welcome addition.
  546. -- Made the KR code check if the other PK systems are included [provides error when building otherwise].
  547. -- Made "aes" an alias for Rijndael via a pre-processor macro. Now you can use "aes_ecb_encrypt", etc... :-)
  548. Thanks to Jean-Luc Cooke for the "buzzword conformance" suggestion.
  549. -- Removed the old PK code entirely (e.g. rsa_sign, dh_encrypt). The *_sign_hash and *_encrypt_key functions
  550. are all that is to remain.
  551. -- **NOTE** Changed the PK *_import (including the keyring) routine to accept a "inlen" parameter. This fixes a
  552. bug where improperly made key packets could result in reading passed the end of the buffer. This means
  553. the code is no longer source compatible but still binary compatible.
  554. -- Fixed a few other minor bugs in the PK import code while I was at it.
  555. Nov 26th, 2002
  556. v0.77 -- Updated the XTEA code to use pre-computed keys. With optimizations for speed it achieves 222Mbit/sec
  557. compared to the 121Mbit/sec before. It is 288 bytes bigger than before.
  558. -- Cleaned up some of the ciphers and hashes (coding style, cosmetic changes)
  559. -- Optimized AES slightly for 256-bit keys [only one if statement now, still two for 192-bit keys]
  560. -- Removed most test cases from Blowfish, left three of them there. Makes it smaller and faster to test.
  561. -- Changed the primality routines around. I now use 8 rounds of Rabin-Miller, I use 256 primes in the sieve
  562. step and the "rand_prime" function uses a modified sieve that avoids alot of un-needed bignum work.
  563. -- Fixed a bug in the ECC/DH signatures where the keys "setting" value was not checked for validity. This means
  564. that a invalid value could have caused segfaults, etc...
  565. -- **NOTE** Changed the way the ECC/DH export/import functions work. They are source but not binary compatible
  566. with v0.76. Essentially insteading of exporting the setting index like before I export the key size. Now
  567. if you ever re-configure which key settings are supported the lib will still be able to make use of your
  568. keys.
  569. -- Optimized Blowfish by inlining the round function, unrolling it for four rounds then using a for loop for the
  570. rest. It achieves a rate of 425Mbit/sec with the new code compared to 314Mbit/sec before. The new blowfish
  571. object file is 7,813 bytes compared to 8,663 before and is 850 bytes smaller. So the code is both smaller and
  572. faster!
  573. -- Optimized Twofish as well by inlining the round function. Gets ~400Mbit/sec compared to 280Mbit/sec before
  574. and the code is only 78 bytes larger than the previous copy.
  575. -- Removed SMALL_PRIME_TAB build option. I use the smaller table always.
  576. -- Fixed some mistakes concerning prime generation in the manual.
  577. -- [Note: sizes/speeds are for GCC 3.2 on an x86 Athlon XP @ 1.53Ghz]
  578. Nov 25th, 2002
  579. v0.76 -- Updated makefiles a bit more, use "-Os" instead of "-O2" to optimize for size. Got the lib
  580. downto 265KB using GCC 3.2 on my x86 box.
  581. -- Updated the SAFER+, Twofish and Rijndael test vector routine to use the table driven design.
  582. -- Updated all other test vector routines to return as soon as an error is found
  583. -- fixed a bug in the test program where errors in the hash test routines would not be reported
  584. correctly. I found this by temporarily changing one of the bytes of the test vectors. All the
  585. hashes check out [the demos/test.c would still have reported an error, just the wrong one].
  586. Nov 24th, 2002
  587. v0.75 -- Fixed a flaw in hash_filehandle, it should ARGCHK that the filehandle is not NULL
  588. -- Fixed a bug where in hash_file if the call to hash_filehandle failed the open file would
  589. not be closed.
  590. -- Added more strict rules to build process, starting to weed out "oh this works in GCC" style code
  591. In the next release "-Wconversion" will be enabled which will deal with all implicit casts.
  592. Nov 22nd, 2002 [later in the day]
  593. v0.74 -- Wrote a small variant of SAFER+ which shaved 50KB off the size of the library on x86 platforms
  594. -- Wrote a build option to remove the PK packet functions [keeps the encrypt_key/sign_hash functions]
  595. -- Wrote a small variant of Rijndael (trimmed 13KB)
  596. -- Trimmed the TIGER/192 hash function a bit
  597. -- Overall the entire lib compiled is 295KB [down from 400KB before]
  598. -- Fixed a few minor oversights in the MSVC makefile
  599. Nov 22nd, 2002
  600. v0.73 -- Fixed bug in RC4 code where it could only use 255 byte keys.
  601. -- Fixed bug in yarrow code where it would allow cast5 or md2 to be used with it...
  602. -- Removed the ecc compress/expand points from the global scope. Reduces namespace polution
  603. -- Fixed bug where if you used the SPRNG you couldn't pass NULL as your prng_state which you should be
  604. able todo since the SPRNG has no state...
  605. -- Corrected some oversights in the manual and the examples...
  606. -- By default the GF(2^W) math library is excluded from the build. The source is maintained because I wrote it
  607. and like it :-). This way the built library is a tad smaller
  608. -- the MSVC makefile will now build for a SPACE optimized library rather than TIME optimized.
  609. Nov 21th, 2002
  610. v0.72 -- Fixed bug in the prime testing. In the Miller-Rabin test I was raising the base to "N-1" not "r".
  611. The math still worked out fine because in effect it was performing a Fermat test. Tested the new code and it
  612. works properly
  613. -- Fixed some of the code where it was still using the old error syntax
  614. -- Sped up the RSA decrypt/sign routines
  615. -- Optimized the ecc_shared_secret routine to not use so much stack
  616. -- Fixed up the makefile to make releases where the version # is in the file name and directory it will unzip
  617. to
  618. Nov 19th, 2002
  619. v0.71 -- HELP TOM. I need tuition for the January semester. Now I don't want to force donations [nor will I ever]
  620. but I really need the help! See my website http://tom.iahu.ca/help_tom.html for more details. Please help
  621. if you can!
  622. --------------------------------------------------------------------------------------------------------------
  623. -- Officially the library is no longer supported in GCC 3.2 in windows [cygwin].
  624. In windows you can either use GCC 2.95.3 or try your luck with 3.2 It seems that
  625. "-fomit-frame-pointer" is broken in the windows build [but not the linux x86 build???]
  626. If you simply must use 3.2 then I suggest you limit the optimizations to simply "-O2"
  627. -- Started new error handling API. Similar to the previous except there are more error codes than just
  628. CRYPT_ERROR
  629. -- Added my implementation of the MD2 hash function [despite the errors in the RFC I managed to get it right!]
  630. -- Merged in more changes from Sky Schulz. I have to make mention here that he has been a tremendous help in
  631. getting me motivated to make some much needed updates to the library!
  632. -- Fixed one of the many mistakes in the manual as pointed out by Daniel Richards
  633. -- Fixed a bug in the RC4 code [wasn't setting up the key correctly]
  634. -- Added my implementation of the CAST5 [aka CAST-128] block cipher (conforms...)
  635. -- Fixed numerous bugs in the PK code. Essentially I was "freeing" keys when the import failed. This is neither
  636. required nor a good a idea [double free].
  637. -- Tom needs a job.
  638. -- Fixed up the test harness as requested by Sky Schulz. Also modifed the timing routines to run for X seconds
  639. and count # of ops performed. This is more suitable than say encrypting 10 million blocks on a slow processor
  640. where it could take minutes!
  641. -- Modified test programs hashsum/encrypt to use the new algorithms and error handling syntax
  642. -- Removed the PKCS code since it was incomplete. In the future I plan on writing a "add-on" library that
  643. provides PKCS support...
  644. -- updated the config system so the #defines are in the makefiles instead of mycrypt_cfg.h
  645. -- Willing to work on an hourly basis for 15$ CDN per hour.
  646. -- updated the test program to not test ciphers not included
  647. -- updated the makefile to make "rsa_sys.c" a dependency of rsa.o [helps develop the code...]
  648. -- fixed numerous failures to detect buffer overflows [minor] in the PK code.
  649. -- fixed the safer [64-bit block version] test routines which didn't check the returns of the setup
  650. function
  651. -- check out my CV at http://tom.iahu.ca/cv.html
  652. -- removed the GBA makefile and code from demos/test.c [not a particularly useful demo...]
  653. -- merged in rudimentary [for testing] PS2 RNG from Sky Schulz
  654. -- merged in PS2 timer code [only shell included due to NDA reasons...]
  655. -- updated HMAC code to return errors where possible
  656. -- Thanks go to Sky Schulz who bought me a RegCode for TextPad [the official editor of libtomcrypt]
  657. Nov 12th, 2002
  658. v0.70 -- Updated so you can swap out the default malloc/calloc/free routines at build time with others. (Sky Schulz)
  659. -- Sky Schulz contributed some code towards autodetecting the PS2 in mycrypt_cfg.h
  660. -- Added PS2 makefile contributed by Sky Schulz [see a pattern forming?]
  661. -- Added ability to have no FILE I/O functions at all (see makefile), Sky Schulz....
  662. -- Added support for substituting out the clock() function (Sky Schulz)
  663. -- Fixed up makefile to include new headers in the HEADERS variable
  664. -- Removed "coin.c" as its not really useful anyways
  665. -- Removed many "debug" printfs that would show up on failures. Basically I wanted to ensure the only output
  666. would be from the developer themselves.
  667. -- Added "rc4.c" a RC4 implementation with a PRNG interface. Since RC4 isn't a block cipher it wouldn't work
  668. too well as a block cipher.
  669. -- Fixed ARGCHK macro usage when ARGTYPE=1 throughout the code
  670. -- updated makefile to make subdirectory properly (Sku Schulz)
  671. -- Started towards new API setup. Instead of checking for "== CRYPT_ERROR" you should check "!= CRYPT_OK"
  672. In future releases functions will return things other than CRYPT_ERROR on error to give more useful
  673. thread safe error reporting. The manual will be updated to reflect this. For this release all
  674. errors are returned as CRYPT_ERROR (except as noted) but in future releases this will change.
  675. -- Removed the zlib branch since its not really required anyways. Makes the package smaller
  676. Nov 11th, 2002
  677. v0.69 -- Added ARGCHK (see mycrypt_argchk.h) "arguement checking" to all functions that accept pointers
  678. -- Note I forgot to change the CRYPT version tag in v0.68... fixed now.
  679. Nov 8th, 2002
  680. v0.68 -- Fixed flaw in kr_import/kr_export that wasted 4 bytes. Source but not binary compatible with v0.67
  681. -- Fixed bug in kr_find_name that used memcmp to match strings. Uses strncmp now.
  682. -- kr_clear now sets the pointer to NULL to facilate debugging [e.g. using the keyring after clearing]
  683. -- static functions in _write/_read in keyring.c now check the return of ctr_encrypt/ctr_decrypt.
  684. -- Updated blowfish/rc2/rc5/rc6 keysize() function to not reject keys larger than the biggest key the
  685. respective ciphers can use.
  686. -- Fixed a bug in hashsum demo that would report the hash for files that don't exist!
  687. Oct 16th, 2002
  688. v0.67 -- Moved the function prototypes into files mycrypt_*.h. To "install" the lib just copy all the
  689. header files "*.h" from the base of this project into your global include path.
  690. -- Made the OFB/CFB/CTR functions use "unsigned long" for the length instead of "int"
  691. -- Added keyring support for the PK functions
  692. -- ***API CHANGE*** changed the ecc_make_key and dh_make_key to act more like rsa_make_key. Basically
  693. move the first argument to the next to last.
  694. -- Fixed bug in dh_test() that wouldn't test the primality of the order of the sub-group
  695. -- replaced the primes in the DH code with new ones that are larger than the size they are
  696. associated with. That is a 1024-bit DH key will have a 1025-bit prime as the modulus
  697. -- cleaned up all the PK code, changed a bit of the API around [not source compatible with v0.66]
  698. -- major editing of the manual, started Docer program
  699. -- added 160 and 224 bit key settings for ECC. This makes the DH and ECC binary wise incompatible with v0.66
  700. -- Added an additional check for memory errors in is_prime() and cleaned up prime.c a bit
  701. -- Removed ID_TAG from all files [meh, not a big fan...]
  702. -- Removed unused variable from yarrow state and made AES/SHA256 the default cipher/hash combo
  703. -- Fixed a bug in the Yarrow code that called prng_is_valid instead of cipher_is_valid from yarrow_start()
  704. -- The ECB/CBC/OFB/CFB/CTR wrappers now check that the cipher is valid in the encrypt/decrypt calls
  705. Returns int now instead of void.
  706. Sept 24th, 2002
  707. v0.66 -- Updated the /demos/test.c program to time the hashes correctly. Also it uses the yarrow PRNG for all of the
  708. tests meaning its possible to run on RNG less platforms
  709. -- Updated the /demos/hashsum.c program to hash from the standard input
  710. -- Updated the RSA code to make keys a bit quicker [update by Wayne Scott] by not making both primes at the same
  711. time.
  712. -- Dan Kaminsky suggested some cleanups for the code and the MPI config
  713. Code ships in unix LF format by default now too... will still build in MSVC and all... but if you want
  714. to read the stuff you'll have to convert it
  715. -- Changes to the manual to reflect new API [e.g. hash_memory/file have v0.65 prototypes]and some typos fixed
  716. Sept 20th, 2002
  717. v0.65 -- Wayne Scott ([email protected]) made a few of suggestions to improve the library. Most
  718. importantly he pointed out the math lib is not really required. He's also tested the lib on 18
  719. different platforms. According to him with only a few troubles [lack of /dev/random, etc] the
  720. library worked as it was supposed to. You can find the list at
  721. http://www.bitkeeper.com/Products.BitKeeper.Platforms.html
  722. -- Updated the hash_file and hash_memory functions to keep track of the size of the output
  723. -- Wayne Scott updated the demos/test.c file to use the SPRNG less and Yarrow more
  724. -- Modified the mycrypt_cfg.h to autodetect x86-32 machines
  725. Sept 19th, 2002
  726. v0.64 -- wrote makefile for the GBA device [and hacked the demos/test.c file to support it conditionally]
  727. -- Fixed error in PK (e.g. ECC, RSA, DH) import functions where I was clobbering the packet error messages
  728. -- fixed more typos in the manual
  729. -- removed all unused variables from the core library (ignore the ID_TAG stuff)
  730. -- added "const char *crypt_build_settings" string which is a build time constant that gives a listing
  731. of all the build time options. Useful for debugging since you can send that to me and I will know what
  732. exactly you had set for the mycrypt_cfg.h file.
  733. -- Added control over endianess. Out of the box it defaults to endianess neutral but you can trivially
  734. configure the library for your platform. Using this I boosted RC5 from 660Mbit/sec to 785Mbit/sec on my
  735. Athlon box. See "mycrypt_cfg.h" for more information.
  736. Sept 11th, 2002
  737. v0.63 -- Made hashsum demo output like the original md5sum program
  738. -- Made additions to the examples in the manual (fixed them up a bunch)
  739. -- Merged in the base64 code from Wayne Scott ([email protected])
  740. Aug 29th, 2002
  741. v0.62 -- Added the CLEAN_STACK functionality to several of the hashes I forgot to update.
  742. Aug 9th, 2002
  743. v0.61 -- Fixed a bug in the DES code [oops I read something wrong].
  744. Aug 8th, 2002
  745. v0.60 -- Merged in DES code [and wrote 3DES-EDE code based on it] from Dobes V.
  746. Aug 7th, 2002
  747. v0.59 -- Fixed a "unsigned long long" bug that caused v0.58 not to build in MSVC.
  748. -- Cleaned up a little in the makefile
  749. -- added code that times the hash functions too in the test program
  750. Aug 3rd, 2002
  751. v0.58 -- Added more stack cleaning conditionals throughout the code.
  752. -- corrected some CLEAR_STACK conditionals... should have been CLEAN_STACK
  753. -- Simplified the RSA, DH and ECC encrypt() routines where they use CTR to encode the message
  754. now they only make one call to ctr_encrypt()/ctr_decrypt().
  755. Aug 2nd, 2002
  756. v0.57 -- Fixed a few errors messages in the SAFER code to actually report the correct cipher name.
  757. -- rsa_encrypt() uses the "keysize()" method of the cipher being used to more accurately pick a
  758. key size. By default rsa_encrypt() will choose to use a 256-bit key but the cipher can turn that
  759. down if required.
  760. -- The rsa_exptmod() function will now more reliably detect invalid inputs (e.g. greater than the modulus).
  761. -- The padding method for RSA is more clearly documented. Namely if you want to encrypt/sign something of length
  762. N then your modulus must be of length 1+3N. So to sign a message with say SHA-384 [48 bytes] you need a
  763. 145 byte (1160 bits) modulus. This is all in the manual now.
  764. -- Added build option CLEAN_STACK which will allow you to choose whether you want to clean the stack or not after every
  765. cipher/hash call
  766. -- Sped up the hash "process()" functions by not copying one byte at a time.
  767. ++ (added just after I uploaded...)
  768. MD4 process() now handles input buffers > 64 bytes
  769. Aug 1st, 2002
  770. v0.56 -- Cleaned up the comments in the Blowfish code.
  771. -- Oh yeah, in v0.55 I made all of the descriptor elements constant. I just forgot to mention it.
  772. -- fixed a couple of places where descriptor indexes were tested wrong. Not a huge bug but now its harder
  773. to mess up.
  774. -- Added the SAFER [64-bit block] ciphers K64, SK64, K128 and SK128 to the library.
  775. -- Added the RC2 block cipher to the library.
  776. -- Changed the SAFER define for the SAFER+ cipher to SAFERP so that the new SAFER [64-bit] ciphers
  777. can use them with less confusion.
  778. July 29th, 2002
  779. v0.55 -- My god stupid Blowfish has yet again been fixed. I swear I hate that cipher. Next bug in it and boom its out of the
  780. library. Use AES or something else cuz I really hate Blowfish at this stage....
  781. -- Partial PKCS support [hint DONT USE IT YET CUZ ITS UNTESTED!]
  782. July 19th, 2002
  783. v0.54 -- Blowfish now conforms to known test vectors. Silly bad coding tom!
  784. -- RC5/RC6/Serpent all have more test vectors now [and they seemed to have been working before]
  785. July 18th, 2002
  786. v0.53 -- Added more test vectors to the blowfish code just for kicks [and they are const now too :-)]
  787. -- added prng/hash/cipher is_valid functions and used them in all of the PK code so you can't enter the code
  788. with an invalid index ever now.
  789. -- Simplified the Yarrow code once again :-)
  790. July 12th, 2002
  791. v0.52 -- Fixed a bug in MD4 where the hash descriptor ID was the same as SHA-512. Now MD4 will work with
  792. all the routines...
  793. -- Fixed the comments in SHA-512 to be a bit more meaningful
  794. -- In md4 I made the PADDING array const [again to store it in ROM]
  795. -- in hash_file I switched the constant "512" to "sizeof(buf)" to be a bit safer
  796. -- in SHA-1's test routine I fixed the string literal to say SHA-1 not sha1
  797. -- Fixed a logical error in the CTR code which would make it skip the first IV value. This means
  798. the CTR code from v0.52 will be incompatible [binary wise] with previous releases but it makes more
  799. sense this way.
  800. -- Added {} braces for as many if/for/blocks of code I could find. My rule is that every for/if/while/do block
  801. must have {} braces around it.
  802. -- made the rounds table in saferp_setup const [again for the ROM think about the ROM!]
  803. -- fixed RC5 since it no longer requires rc5 to be registered in the lib. It used to since the descriptors used to
  804. be part of the table...
  805. -- the packet.c code now makes crypt_error literal string errors when an error occurs
  806. -- cleaned up the SAFER+ key schedule to be a bit easier to read.
  807. -- fixed a huge bug in Twofish with the TWOFISH_SMALL define. Because I clean the stack now I had
  808. changed the "g_func()" to be called indirectly. I forgot to actually return the return of the Twofish
  809. g_func() function which caused it not to work... [does now :-)]
  810. July 11th, 2002
  811. v0.51 -- Fixed a bug in SHA512/384 code for multi-block messages.
  812. -- Added more test vectors to the SHA384/512 and TIGER hash functions
  813. -- cleaned up the hash done routines to make more sense
  814. July 10th, 2002
  815. v0.50 -- Fixed yarrow.c so that the cipher/hash used would be registered. Also fixed
  816. a bug where the SAFER+ name was "safer" but should have been "safer+".
  817. -- Added an element to the hash descriptors that gives the size of a block [sent into the compressor]
  818. -- Cleaned up the support for HMAC's
  819. -- Cleaned up the test vector routines to make the test vector data const. This means on some platforms it will be
  820. placed in ROM not RAM now.
  821. -- Added MD4 code submited by Dobes Vandermeer ([email protected])
  822. -- Added "burn_stack" function [idea taken from another source of crypto code]. The idea is if a function has
  823. alot of variables it will clean up better. Functions like the ecb serpent and twofish code will now have their
  824. stacks cleaned and the rest of the code is getting much more straightforward.
  825. -- Added a hashing demo by Daniel Richards ([email protected])
  826. -- I (Tom) modified some of the test vector routines to use more vectors ala Dobes style.
  827. For example, the MD5/SHA1 code now uses all of the test vectors from the RFC/FIPS spec.
  828. -- Fixed the register/unregister functions to properly report errors in crypt_error
  829. -- Correctly updated yarrow code to remove a few unused variables.
  830. -- Updated manual to fix a few erroneous examples.
  831. -- Added section on Hash based Message Authentication Codes (HMAC) to the manual
  832. June 19th, 2002
  833. v0.46 -- Added in HMAC code from Dobes Vandermeer ([email protected])
  834. June 8th, 2002
  835. v0.45 -- Fixed bug in rc5.c where if you called rc5_setup() before registering RC5 it would cause
  836. undefined behaviour.
  837. -- Fixed mycrypt_cfg.h to eliminate the 224 bit ECC key.
  838. -- made the "default" makefile target have depends on mycrypt.h and mycrypt_cfg.h
  839. Apr 4th, 2002
  840. v0.44 -- Fixed bug in ecc.c::new_point() where if the initial malloc fails it would not catch it.
  841. Mar 22nd, 2002
  842. v0.43 -- Changed the ZLIB code over to the 1.1.4 code base to avoid the "double free" bug.
  843. -- Updated the GCC makefile not to use -O3 or -funroll-loops
  844. -- Version tag in mycrypt.h has been updated :-)
  845. Mar 10th, 2002
  846. v0.42 -- The RNG code can now use /dev/urandom before trying /dev/random (J. Klapste)
  847. Mar 3rd, 2002
  848. v0.41 -- Added support to link and use ciphers at compile time. This can greatly reduce the code size!
  849. -- Added a demo to show off how small an application can get... 46kb!
  850. -- Disastry pointed out that Blowfish is supposed to be high endian.
  851. -- Made registry code for the PRNGs as well [now the smallest useable link is 43kb]
  852. Feb 11th, 2002
  853. v0.40 -- RSA signatures use [and check for] fixed padding scheme.
  854. -- I'm developing in Linux now :-)
  855. -- No more warnings from GCC 2.96
  856. Feb 5th, 2002
  857. v0.39 -- Updated the XTEA code to work in accordance with the XTEA design
  858. January 24th, 2002
  859. v0.38 -- CFB and OFB modes can now handle blocks of variable size like the CTR code
  860. -- Wrote a wrapper around the memory compress functions in Zlib that act like the functions
  861. in the rest of my crypto lib
  862. January 23rd, 2002
  863. v0.37 -- Added support code so that if a hash size and key size for a cipher don't match up they will
  864. use the next lower key supported. (mainly for the PK code). So you can now use SHA-1 with
  865. Twofish, etc...
  866. -- Added more options for Twofish. You can now tell it to use precomputed sboxes and MDS multiplications
  867. This will speed up the TWOFISH_SMALL implementation by increasing the code size by 1024 bytes.
  868. -- Fixed a bug in prime.c that would not use the correct table if you undefined SMALL_PRIME_TAB
  869. -- Fixed all of the PK packet code to use the same header format [see packet.c]. This makes the PK code
  870. binary wise incompatible with previous releases while the API has not changed at all.
  871. January 22nd, 2002
  872. v0.36 -- Corrections to the manual
  873. -- Made a modification to Twofish which lets you build a "small ram" variant. It requires
  874. about 190 bytes of ram for the key storage compared to the 4,200 bytes the normal
  875. variant requires.
  876. -- Reduced the stack space used in all of the PK routines.
  877. January 19th, 2002
  878. v0.35 -- If you removed the first hash or cipher from the library it wouldn't return an error if
  879. you used an ID=0 [i.e blowfish or sha256] in any routine. Now it checks for that and will
  880. return an error like it should
  881. -- Merged in new routines from Clay Culver. These routines are for the PK code so you can easily
  882. encode a symmetric key for multiple recipients.
  883. -- Made the ecc and DH make_key() routines make secret keys of the same size as the keysize listed.
  884. Originally I wanted to ensure that the keys were smaller than the order of the field used
  885. However, the bias is so insignifcant using full sizes. For example, with a ECC-192 key the order
  886. is about 2^191.99, so instead I rounded down and used a 184-bit secret key. Now I simply use a full 192-bit
  887. key the code will work just the same except that some 192-bit keys will be duplicates which is not a big
  888. deal since 1/2^192 is a very small bias!
  889. -- Made the configuration a bit simpler and more exacting. You can for example now select which DH or ECC
  890. key settings you wish to support without including the data for all other key settings. I put the #defines
  891. in a new file called "mycrypt_cfg.h"
  892. -- Configured "mpi-config.h" so its a bit more conservative with the memory required and code space used
  893. -- Jason Klapste submitted bug fixes to the yarrow, hash and various other issues. The yarrow code will now
  894. use what ever remaining hash/cipher combo is left [after you #undef them] at build time. He also suggested
  895. a fix to remove unused structures from the symmetric_key and hash_state unions.
  896. -- Made the CTR code handle variable length blocks better. It will buffer the encryption pad so you can
  897. encrypt messages any size block at a time.
  898. -- Simplified the yarrow code to take advantage of the new CTR code.
  899. -- Added a 4096-bit DH key setting. That took me about 36 hours to find!
  900. -- Changed the base64 routines to use a real base64 encoding scheme.
  901. -- Added in DH and ECC "encrypt_key()" functions. They are still rather "beta"ish.
  902. -- Added **Twofish** to the list of ciphers!
  903. January 18th, 2002
  904. v0.34 -- Added "sha512" to the list of hashes. Produces a 512-bit message digest. Note that with the current
  905. padding with the rsa_sign() function you cannot use sha512 with a key less than 1536 bits for signatures.
  906. -- Cleaned up the other hash functions to use the LOAD and STORE macros...
  907. January 17th, 2002
  908. v0.33 -- Made the lower limit on keysizes for RSA 1024 bits again because I realized that 768 bit keys wouldn't
  909. work with the padding scheme and large symmetric keys.
  910. -- Added information concerning the Zlib license to the manual
  911. -- Added a 3072-bit key setting for the DH code.
  912. -- Made the "find_xyz()" routines take "const char *" as per Clay Culver's suggestion.
  913. -- Fixed an embarassing typo in the manual concerning the hashes. Thank's Clay for finding it!
  914. -- Fixed rand_prime() so that it makes primes bigger than the setting you give. For example,
  915. if you want a 1024-bit prime it would make a 1023-bit one. Now it ensures that the prime
  916. it makes is always greater than 2^(8n) (n == bytes in prime). This doesn't have a huge
  917. impact on security but I corrected it just the same.
  918. -- Fixed the CTR routine to work on platforms where char != 8-bits
  919. -- Fixed sha1/sha256/md5/blowfish to not assume "unsigned long == 32-bits", Basically any operation with carries
  920. I "AND" with 0xFFFFFFFF. That forces only the lower 32-bits to have information in it. On x86 platforms
  921. most compilers optimize out the AND operation since its a nop.
  922. January 16th, 2002
  923. v0.32 -- Made Rijndael's setup function fully static so it is thread safe
  924. -- Svante Seleborg suggested a cosmetic style fixup for aes.c,
  925. basically to remove some of the #defines to clean it up
  926. -- Made the PK routines not export the ASCII version of the names of ciphers/hashes which makes
  927. the PK message formats *incompatible* with previous releases.
  928. -- Merge in Zlib :-)
  929. January 15th, 2002
  930. v0.31 -- The RSA routines can now use CRT to speed up decryption/signatures. The routines are backwards
  931. compatible with previous releases.
  932. -- Fixed another bug that Svante Seleborg found. Basically you could buffer-overrun the
  933. rsa_exptmod() function itself if you're not careful. That's fixed now. Fixed another bug in
  934. rsa_exptmod() where if it knows the buffer you passed is too small it wouldn't free all used
  935. memory.
  936. -- improved the readability of the PK import/export functions
  937. -- Added a fix to RSA.C by Clay Culver
  938. -- Changed the CONST64 macro for MSVC to use the "unsigned __int64" type, e.g. "ui64" instead of "i64".
  939. January 14th, 2002
  940. v0.30 -- Major change to the Yarrow PRNG code, fixed a bug that Eugene Starokoltsev found.
  941. Basically if you added entropy to the pool in small increments it could in fact
  942. cancel out. Now I hash the pool with the new data which is way smarter.
  943. January 12th, 2002
  944. v0.29 -- Added MPI code written by Svante Seleborg to the library. This will make the PK code much
  945. easier to follow and debug. Actually I've already fixed a memory leak in dh_shared_secret().
  946. -- Memory leaks found and correct in all three PK routines. The leaks would occur when a bignum
  947. operation fails so it wouldn't normally turn up in the course of a program
  948. -- Fixed bugs in dh_key_size and ecc_key_size which would return garbage for invalid key idx'es
  949. January 11th, 2002
  950. v0.28 -- Cleaned up some code so that it doesn't assume "char == 8bits". Mainly SAFER+ has been
  951. changed.
  952. -- ***HUGE*** changes in the PK code. I check all return values in the bignum code so if there
  953. are errors [insufficient memory, etc..] it will be reported. This makes the code fairly more
  954. robust and likely to catch any errors.
  955. -- Updated the is_prime() function to use a new prototype [it can return errors now] and it also
  956. does trial divisions against more primes before the Rabin Miller steps
  957. -- Added OFB, CFB and ECB generic wrappers for the symmetric ciphers to round out the implementations.
  958. -- Added Xtea to the list of ciphers, to the best of my ability I have verified this implementation.
  959. I should note that there is not alot of concrete information about the cipher. "Ansi C" versions
  960. I found did not address endianess and were not even portable!. This code is portable and to the
  961. best of my knowledge implements the Xtea algorithm as per the [short] X-Tea paper.
  962. -- Reformated the manual to include the **FULL** source code optimized to be pritable.
  963. January 9th, 2002
  964. v0.27 -- Changed the char constants to numerical values. It is backwards compatible and should work on
  965. platforms where 'd' != 100 [for example].
  966. -- Made a change to rand_prime() which takes the input length as a signed type so you can pass
  967. a negative len to get a "3 mod 4" style prime... oops
  968. -- changed the MSVC makefile to build with a warning level of three, no warnings!
  969. January 8th, 2002
  970. v0.26 -- updated SHA-256 to use ROR() for a rotate so 64-bit machines won't corrupt
  971. the output
  972. -- Changed #include <> to #include "" for local .h files as per Richard Heathfields' suggestions.
  973. -- Fixed bug in MPI [well bug in MSVC] that compiled code incorrectly in mp_set_int()
  974. I added a work around that catches the error and continues normally.
  975. January 8th, 2002
  976. v0.25 -- Added a stupid define so MSVC 6.00 can build the library.
  977. -- Big thanks to sci.crypt and "Ajay K. Agrawal" for helping me port this to MSVC
  978. January 7th, 2002
  979. v0.24 -- Sped up Blowfish by unrolling and removing the swaps.
  980. -- Made the code comply with more traditional ANSI C standards
  981. Should compile with MSVC with less errors
  982. -- moved the demos and documentation into their own directories
  983. so you can easily build the library with other tool chains
  984. by compiling the files in the root
  985. -- converted functions with length of outputs to use
  986. "unsigned long" so 16-bit platforms will like this library more.
  987. January 5th, 2002
  988. v0.23 -- Fixed a small error in the MPI config it should build fine anywhere.
  989. January 4th, 2002
  990. v0.22 -- faster gf_mul() code
  991. -- gf_shl() and gf_shr() are safe on 64-bit platforms now
  992. -- Fixed an error in the hashes that Brian Gladman found.
  993. Basically if the message has exactly 56 bytes left to be
  994. compressed I handled them incorrectly.
  995. January 4th, 2002
  996. v0.21 -- sped up the ECC code by removing redundant divisions in the
  997. point add and double routines. I also extract the bits more
  998. efficiently in "ecc_mulmod()" now.
  999. -- sped up [and documented] the rand_prime() function. Now it just
  1000. makes a random integer and increments by two until a prime is found
  1001. This is faster since it doesn't require alot of calls to the PRNG and
  1002. it doesn't require loading huge integers over and over. rand_prime()
  1003. can also make primes congruent to 3 mod 4 [i.e for a blum integer]
  1004. -- added a gf_sqrt() function that finds square roots in a GF(2^w) field
  1005. -- fixed a bug in gf_div() that would return the wrong results if the divisor had a greator
  1006. divisor than the dividend.
  1007. January 4th, 2002
  1008. v0.20 -- Added the fixed MPI back in so RSA and DH are much faster again
  1009. v0.19 -- Updated the manual to reflect the fact that Brian Gladman wrote the AES and Serpent code.
  1010. -- DH, ECC and RSA signature/decryption functions check if the key is private
  1011. -- new DH signature/verification code works just like the RSA/ECC versions
  1012. January 3rd, 2002
  1013. v0.18 -- Added way more comments to each .C file
  1014. -- fixed a bug in cbc_decrypt(pt, ct, key) where pt == ct [i.e same buffer]
  1015. -- fixed RC5 so it reads the default rounds out of the cipher_descriptor table
  1016. -- cleaned up ecc_export()
  1017. -- Cleaned up dh_import() and ecc_import() which also perform more
  1018. error checking now
  1019. -- Fixed a serious flaw in rsa_import() with private keys.
  1020. January 2nd, 2002
  1021. v0.17 -- Fixed a bug in the random prime generator that fixes the wrong bits to one
  1022. -- ECC and DH code verify that the moduli and orders are in fact prime. That
  1023. slows down the test routines alot but what are you gonna do?
  1024. -- Fixed a huge bug in the mp_exptmod() function which incorrectly calculates g^x mod p for some
  1025. values of p. I replaced it with a slow function. Once the author of MPI fixes his faster routine
  1026. I will switch back.
  1027. January 1st, 2002 [whoa new year!]
  1028. v0.16 -- Improved GF division code that is faster.
  1029. -- documented the GF code
  1030. December 31st, 2001
  1031. v0.15 -- A 1792-bit and 2048-bit DH setting was added. Took me all night to
  1032. find a 1792 and 2048-bit strong prime but what the heck
  1033. -- Library now has polynomial-basis GF(2^w) routines I wrote myself. Can be used to perform
  1034. ECC over GF(2^w) later on....
  1035. -- Fixed a bug with the defines that allows it to build in windows
  1036. December 30th, 2001
  1037. v0.14 -- Fixed the xxx_encrypt() packet routines to make an IV of appropriate size
  1038. for the cipher used. It was defaulting to making a 256-bit IV...
  1039. -- base64_encode() now appends a NULL byte, um "duh" stupid mistake now fixed...
  1040. -- spell checked the manual again... :-)
  1041. December 30th, 2001
  1042. v0.13 -- Switching back to older copy of MPI since it works! arrg..
  1043. -- Added sign/verify functions for ECC
  1044. -- all signature verification routines default to invalid signatures.
  1045. -- Changed all calls to memset to zeromem. Fixed up some buffer problems
  1046. in other routines. All calls to zeromem let the compiler determine the size
  1047. of the data to wipe.
  1048. December 29th, 2001
  1049. v0.12 -- Imported a new version of MPI [the bignum library] that should
  1050. be a bit more stable [if you want to write your own bignum
  1051. routines with the library that is...]
  1052. -- Manual has way more info
  1053. -- hash_file() clears stack now [like it should]
  1054. -- The artificial cap on the hash input size of 2^32 bits has been
  1055. removed. Basically I was too lazy todo 64-bit math before
  1056. [don't ask why... I can't remember]. Anyways the hashes
  1057. support the size of 2^64 bits [if you ever use that many bits in a message
  1058. that's just wierd...]
  1059. -- The hashes now wipe the "hash_state" after the digest is computed. This helps
  1060. prevent the internal state of the hash being leaked accidently [i.e stack problems]
  1061. December 29th, 2001
  1062. v0.11 -- Made #define's so you can trim the library down by removing
  1063. ciphers, hashs, modes of operation, prngs, and even PK algorithms
  1064. For example, the library with rijndael+ctr+sha1+ECC is 91KB compared
  1065. to the 246kb the full library takes.
  1066. -- Added ECC packet routines for encrypt/decrypt/sign/verify much akin to
  1067. the RSA packet routines.
  1068. -- ECC now compresses the public key, a ECC-192 public key takes 33 bytes
  1069. for example....
  1070. December 28th, 2001
  1071. v0.10 -- going to restart the manual from scratch to make it more
  1072. clear and professional
  1073. -- Added ECC over Z/pZ. Basically provides as much as DH
  1074. except its faster since the numbers are smaller. For example,
  1075. A comparable 256-bit ECC key provides as much security as expected
  1076. from a DH key over 1024-bits.
  1077. -- Cleaned up the DH code to not export the symbol "sets[]"
  1078. -- Fixed a bug in the DH code that would not make the correct size
  1079. random string if you made the key short. For instance if you wanted
  1080. a 512-bit DH key it would make a 768-bit one but only make up 512-bits
  1081. for the exponent... now it makes the full 768 bits [or whatever the case
  1082. is]
  1083. -- Fixed another ***SERIOUS*** bug in the DH code that would default to 768-bit
  1084. keys by mistake.
  1085. December 25th, 2001
  1086. v0.09 -- Includes a demo program called file_crypt which shows off
  1087. how to use the library to make a command line tool which
  1088. allows the user to encode/decode a file with any
  1089. hash (on the passphrase) and cipher in CTR mode.
  1090. -- Switched everything to use typedef's now to clear up the code.
  1091. -- Added AES (128/192 and 256 bit key modes)
  1092. December 24th, 2001
  1093. v0.08 -- fixed a typo in the manual. MPI stores its bignums in
  1094. BIG endian not little.
  1095. -- Started adding a RNG to the library. Right now it tries
  1096. to open /dev/random and if that fails it uses either the
  1097. MS CSP or the clock drift RNG. It also allows callbacks
  1098. since the drift RNG is slow (about 3.5 bytes/sec)
  1099. -- the RNG can also automatically setup a PRNG as well now
  1100. v0.07 -- Added basic DH routines sufficient to
  1101. negotiate shared secrets
  1102. [see the manual for a complete example!]
  1103. -- Fixed rsa_import to detect when the input
  1104. could be corrupt.
  1105. -- added more to the manual.
  1106. December 22nd, 2001
  1107. v0.06 -- Fixed some formatting errors in
  1108. the hash functions [just source code cleaning]
  1109. -- Fixed a typo in the error message for sha256 :-)
  1110. -- Fixed an error in base64_encode() that
  1111. would fail to catch all buffer overruns
  1112. -- Test program times the RSA and symmetric cipher
  1113. routines for kicks...
  1114. -- Added the "const" modifier to alot of routines to
  1115. clear up the purpose of each function.
  1116. -- Changed the name of the library to "TomCrypt"
  1117. following a suggestion from a sci.crypt reader....
  1118. v0.05 -- Fixed the ROL/ROR macro to be safe on platforms
  1119. where unsigned long is not 32-bits
  1120. -- I have added a bit more to the documentation
  1121. manual "crypt.pdf" provided.
  1122. -- I have added a makefile for LCC-Win32. It should be
  1123. easy to port to other LCC platforms by changing a few lines.
  1124. -- Ran a spell checker over the manual.
  1125. -- Changed the header and library from "crypt" to "mycrypt" to not
  1126. clash with the *nix package "crypt".
  1127. v0.04 -- Fixed a bug in the RC5,RC6,Blowfish key schedules
  1128. where if the key was not a multiple of 4 bytes it would
  1129. not get loaded correctly.
  1130. December 21st, 2001
  1131. v0.03 -- Added Serpent to the list of ciphers.
  1132. v0.02 -- Changed RC5 to only allow 12 to 24 rounds
  1133. -- Added more to the manual.
  1134. v0.01 -- We will call this the first version.