You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

227 lines
10 KiB

  1. September 29, 2014:
  2. Yesterday I put in some more architecture detection, but it should
  3. really be based on the arch directory, because what's in there really
  4. was a terrible hack. So I've changed it to use $arch/arch_config.h
  5. to get WORD_BITS.
  6. I've tweaked the eBAT construction code to rename the architectures
  7. using test/batarch.map. Maybe I should also rename them internally,
  8. but not yet.
  9. I added some new TODO.txt items. Some folks have been asking for a
  10. more factored library, instead of this combined arithmetic, curve code,
  11. encodings and protocol all-in-one jumble. Likewise the hash and RNG
  12. should be flexible.
  13. I've also been meaning to put more work in on SPAKE2EE, which would
  14. also mean finalizing the Elligator code.
  15. September 18, 2014:
  16. Begin work on a "ref" implementation. Currently this is just the
  17. arch_ref64 architecture. The ref implementation always weak_reduces
  18. after arithmetic, and doesn't use vectors or other hackery. Currently
  19. it still must declare field elements as vector aligned, though,
  20. other code outside the arch directory can be vectorized.
  21. Change goldilocks.c to use field_eq instead of calling deep into field
  22. apis.
  23. September 6, 2014:
  24. Pull in minor changes from David Leon Gil and Nicholas Wilson, with
  25. some adjustments. I hope the adjustments don't break their compiles.
  26. `make bat` now makes a bat which passes supercop-fastbuild, though
  27. the benchmarks are rather different from `make bench`. I need to track
  28. down why.
  29. August 4, 2014:
  30. Experiments and bug fixes.
  31. Add really_memset = memset_s (except not because I'm setting -std=c99),
  32. thanks David Leon Gil. I think I put it in the right places.
  33. Try to work around what I think is a compiler bug in GCC -O3 on non-AVX
  34. platforms. I can't seem to work around it as -Os, so I'm just flagging
  35. a warning (-Werror makes it an error) for now. Will take more
  36. investigation. Thanks Samuel Neves.
  37. Added an experimental (not ready yet!) ARM NEON implementation in
  38. arch_neon_experimental. This implementation seems to work, but needs
  39. more testing. It is currently asm-heavy and not GCC clean. I am
  40. planning to have a flag for it to use intrinsics instead of asm;
  41. currently the intrinsics are commented out. On clang this does ECDH
  42. in 1850kcy on my BeagleBone Black, comparable to Curve41417. Once this
  43. is ready, I will probably move it to arch_neon proper, since arch_neon
  44. isn't particularly tuned.
  45. July 11, 2014:
  46. This is mostly a cleanup release.
  47. Added CRANDOM_MIGHT_IS_MUST config flag (default: 1). When set, this
  48. causes crandom to assume that all features in the target arch will
  49. be available, instead of detecting them. This makes sense because
  50. the rest of the Goldilocks code is not (yet?) able to detect features.
  51. Also, I'd like to submit this to SUPERCOP eventually, and SUPERCOP won't
  52. pass -DMUST_HAVE_XXX on the command line the way the Makefile here did.
  53. Flag EXPERIMENT_CRANDOM_BUFFER_CUTOFF_BYTES to disable the crandom
  54. output buffer. This buffer improves performance (very marginally at
  55. Goldilocks sizes), but can cause problems with forking and VM
  56. snapshotting. By default, the buffer is now disabled.
  57. I've slightly tweaked the Elligator implementation (which is still
  58. unused) to make it easier to invert. This makes anything using Elligator
  59. (i.e. nothing) incompatible with previous releases.
  60. I've been factoring "magic" constants such as curve orders, window sizes,
  61. etc into a few headers, to reduce the effort to port the code to other
  62. primes, curves, etc. For example, I could test the Microsoft curves, and
  63. something like:
  64. x^2 + y^2 = 1 +- 5382[45] x^2 y^2 mod 2^480-2^240-1
  65. ("Goldeneye"? "Ridinghood"?) might be a reasonable thing to try for
  66. 64-bit CPUs.
  67. In a similar vein, most of the internal code has been changed to say
  68. "field" instead of p448, so that a future version of magic.h can decide
  69. which field header to include.
  70. You can now `make bat` to create an eBAT in build/ed448-goldilocks. This
  71. is only minimally tested, though, because SUPERCOP doesn't work on my
  72. machine and I'm too lazy to reverse engineer it. It sets a new macro,
  73. SUPERCOP_WONT_LET_ME_OPEN_FILES, which causes goldilocks_init() to fall
  74. back to something horribly insecure if crandom_init_from_file raises
  75. EMFILE.
  76. Slightly improved documentation.
  77. Removed some old commented-out code; restored the /* C-style */ comment
  78. discipline.
  79. The AMD-64 version should now be GCC clean, at least for reasonably
  80. recent GCC (tested on OS X.9.3, Haswell, gcc-4.9).
  81. History no longer says "2104".
  82. May 3, 2014:
  83. Minor changes to internal routines mean that this version is not
  84. compatible with the previous one.
  85. Added ARM NEON code.
  86. Added the ability to precompute multiples of a partner's public key. This
  87. takes slightly longer than a signature verification, but reduces future
  88. verifications with the precomputed key by ~63% and ECDH by ~70%.
  89. goldilocks_precompute_public_key
  90. goldilocks_destroy_precomputed_public_key
  91. goldilocks_verify_precomputed
  92. goldilocks_shared_secret_precomputed
  93. The precomputation feature are is protected by a macro
  94. GOLDI_IMPLEMENT_PRECOMPUTED_KEYS
  95. which can be #defined to 0 to compile these functions out. Unlike most
  96. of Goldilocks' functions, goldilocks_precompute_public_key uses malloc()
  97. (and goldilocks_destroy_precomputed_public_key uses free()).
  98. Changed private keys to be derived from just the symmetric part. This
  99. means that you can compress them to 32 bytes for cold storage, or derive
  100. keypairs from crypto secrets from other systems.
  101. goldilocks_derive_private_key
  102. goldilocks_underive_private_key
  103. goldilocks_private_to_public
  104. Fixed a number of bugs related to vector alignment on Sandy Bridge, which
  105. has AVX but uses SSE2 alignment (because it doesn't have AVX2). Maybe I
  106. should just switch it to use AVX2 alignment?
  107. Beginning to factor out curve-specific magic, so as to build other curves
  108. with the Goldilocks framework. That would enable fair tests against eg
  109. E-521, Ed25519 etc. Still would be a lot of work.
  110. More thorough testing of arithmetic. Now uses GMP for testing framework,
  111. but not in the actual library.
  112. Added some high-level tests for the whole library, including some (bs)
  113. negative testing. Obviously, effective negative testing is a very difficult
  114. proposition in a crypto library.
  115. March 29, 2014:
  116. Added a test directory with various tests. Currently testing SHA512 Monte
  117. Carlo, compatibility of the different scalarmul functions, and some
  118. identities on EC point ops. Began moving these tests out of benchmarker.
  119. Added scan-build support.
  120. Improved some internal interfaces. Made a structure for Barrett primes
  121. instead of passing parameters individually. Moved some field operations
  122. to places that make more sense, eg Barrett serialize and deserialize. The
  123. deserialize operation now checks that its argument is in [0,q).
  124. Added more documentation.
  125. Changed the names of a bunch of functions. Still not entirely consistent,
  126. but getting more so.
  127. Some minor speed improvements. For example, multiply is now a couple cycles
  128. faster.
  129. Added a hackish attempt at thread-safety and initialization sanity checking
  130. in the Goldilocks top-level routines.
  131. Fixed some vector alignment bugs. Compiling with -O0 should now work.
  132. Slightly simplified recode_wnaf.
  133. Add a config.h file for future configuration. EXPERIMENT flags moved here.
  134. I've decided against major changes to SHA512 for the moment. They add speed
  135. but also significantly bloat the code, which is going to hurt L1 cache
  136. performance. Perhaps we should link to OpenSSL if a faster SHA512 is desired.
  137. Reorganize the source tree into src, test; factor arch stuff into src/arch_*.
  138. Make most of the code 32-bit clean. There's now a 32-bit generic and 32-bit
  139. vectorless ARM version. No NEON version yet because I don't have a test
  140. machine (could use my phone in a pinch I guess?). The 32-bit version still
  141. isn't heavily optimized, but on ARM it's using a nicely reworked signed/phi-adic
  142. multiplier. The squaring is also based on this, but could really stand some
  143. improvement.
  144. When passed an even exponent (or extra doubles), the Montgomery ladder should
  145. now be accept points if and only if they lie on the curve. This needs
  146. additional testing, but it passes the zero bit exponent test.
  147. On 32-bit, use 8x4x14 instead of 5x5x18 table organization. Probably there's
  148. a better heuristic.
  149. March 5, 2014:
  150. First revision.
  151. Private keys are now longer. They now store a copy of the public key, and
  152. a secret symmetric key for signing purposes.
  153. Signatures are now supported, though like everything else in this library,
  154. their format is not stable. They use a deterministic Schnorr mode,
  155. similar to EdDSA. Precomputed low-latency signing is not supported (yet?).
  156. The hash function is SHA-512.
  157. The deterministic hashing mode needs to be changed to HMAC (TODO!). It's
  158. currently envelope-MAC.
  159. Probably in the future there will be a distinction between ECDH key and
  160. signing keys (and possibly also MQV keys etc).
  161. Began renaming internal functions. Removing p448_ prefixes from EC point
  162. operations. Trying to put the verb first. For example,
  163. "p448_isogeny_un_to_tw" is now called "twist_and_double".
  164. Began documenting with Doxygen. Use "make doc" to make a very incomplete
  165. documentation directory.
  166. There have been many other internal changes.
  167. Feb 21, 2014:
  168. Initial import and benchmarking scripts.
  169. Keygen and ECDH are implemented, but there's no hash function.