changes 94 KB

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