]> git.codecow.com Git - Monocypher.git/log
Monocypher.git
6 years agoTypo: 2^255 - 23 => 2^255 - 21
Loup Vaillant [Tue, 19 Nov 2019 07:33:03 +0000 (08:33 +0100)]
Typo: 2^255 - 23 => 2^255 - 21

The previous commit message has the same mistake. Sorry.

6 years agoLeveraged fe_pow22523 to to simplify fe_invert
Loup Vaillant [Mon, 18 Nov 2019 21:41:41 +0000 (22:41 +0100)]
Leveraged fe_pow22523 to to simplify fe_invert

The multiplication chain used in those two function is probably optimal,
but it is also kind of black magic, and takes quite a bit of code.
TweetNaCl has a much shorter, much easier to read, much slower addition
chain. I figured maybe a middle ground were possible.

Turns out it's difficult. I couldn't come up with a nice multiplication
chain on my own. But I did notice a relationship between 2^252 - 3 and
2^255 - 23 (the latter is used to invert): they start with the same bit
pattern. More specifically:

    2^255 - 23 = (2^252 - 3) * 8 + 3

I can use the same multiplication chain for both function, and just
finish the job for the inversion.

The cost of this patch compared to the ref10 multiplication chain is
five field multiplications, three of which are squaring. The effect on
the benchmark is so small that we don't even notice the difference.

The benefit is 10 meaty lines of code, and a corresponding decrease in
binary size.

6 years agoAdded comment
Loup Vaillant [Sat, 2 Nov 2019 19:48:45 +0000 (20:48 +0100)]
Added comment

6 years agoUse TweetNaCl 20140427 without modification
Loup Vaillant [Sat, 2 Nov 2019 19:47:25 +0000 (20:47 +0100)]
Use TweetNaCl 20140427 without modification

6 years agoFixed uninitialised read in speed-c25519
Loup Vaillant [Tue, 29 Oct 2019 22:43:21 +0000 (23:43 +0100)]
Fixed uninitialised read in speed-c25519

6 years agoAdded c25519 speed benchmarks
Loup Vaillant [Mon, 28 Oct 2019 22:24:41 +0000 (23:24 +0100)]
Added c25519 speed benchmarks

6 years agoMoved libhydrogen pkg-config file to the makefile
Loup Vaillant [Fri, 25 Oct 2019 17:53:09 +0000 (19:53 +0200)]
Moved libhydrogen pkg-config file to the makefile

That's the simplest way I know of to respect the PREFIX variable.

6 years agoDocumented LibHydrogen speed benchmark
Loup Vaillant [Fri, 25 Oct 2019 17:42:14 +0000 (19:42 +0200)]
Documented LibHydrogen speed benchmark

6 years agoAdded Libhydrogen speed tests
Loup Vaillant [Wed, 23 Oct 2019 21:39:48 +0000 (23:39 +0200)]
Added Libhydrogen speed tests

6 years agoCosmetic: removed useless comment
Loup Vaillant [Wed, 23 Oct 2019 21:38:31 +0000 (23:38 +0200)]
Cosmetic: removed useless comment

6 years agoRemoved old (now unused) #define
Loup Vaillant [Wed, 23 Oct 2019 06:25:47 +0000 (08:25 +0200)]
Removed old (now unused) #define

6 years agoFixed Clang warning about Doxygen comments
Loup Vaillant [Tue, 22 Oct 2019 21:38:15 +0000 (23:38 +0200)]
Fixed Clang warning about Doxygen comments

comments that begin by //< can be Doxygen comments, and Clang with all
warnings doesn't like that.

I originally packed the comment to satisfy my 80 column OCD.  By
sacrificing space around the + operator however, we can reclaim that
space and please Clang.

6 years agoMerge pull request #131 from fscoto/master+remove-kex-doc
Loup Vaillant [Mon, 21 Oct 2019 18:23:14 +0000 (20:23 +0200)]
Merge pull request #131 from fscoto/master+remove-kex-doc

Remove remaining pieces of kex documentation

6 years agoMerge pull request #130 from fscoto/master+fix-release
Loup Vaillant [Mon, 21 Oct 2019 18:20:51 +0000 (20:20 +0200)]
Merge pull request #130 from fscoto/master+fix-release

Change release.sh to use find -exec

6 years agoRemove remaining pieces of kex documentation
Fabio Scotoni [Mon, 21 Oct 2019 17:49:38 +0000 (19:49 +0200)]
Remove remaining pieces of kex documentation

Related to git commits 6163d8195a3acf2e143d20843a602fd5fb7671d5 and
56b81ae4ec987ba39a2f0ec8b434a4f8efddfef9.

6 years agoChange release.sh to use find -exec
Fabio Scotoni [Mon, 21 Oct 2019 17:46:21 +0000 (19:46 +0200)]
Change release.sh to use find -exec

This avoids some potential weirdness with whitespace in find and for.

6 years agoNo longer overwrite __git__ -> $VERSION replacement
Loup Vaillant [Mon, 21 Oct 2019 15:53:32 +0000 (17:53 +0200)]
No longer overwrite __git__ ->  $VERSION replacement

The replacement was going fine, except for makefile.  This happened
because the new makefile was overwritten by the old (truncated).

Now we truncate in place.

6 years agoUpdated CHANGELOG (2.0.6)
Loup Vaillant [Mon, 21 Oct 2019 13:43:02 +0000 (15:43 +0200)]
Updated CHANGELOG (2.0.6)

6 years agoRemoved tests/vectors.h target from the tarballed makefile
Loup Vaillant [Mon, 21 Oct 2019 13:03:52 +0000 (15:03 +0200)]
Removed tests/vectors.h target from the tarballed makefile

The tests/vectors.h file ships with the tarball, we don't need to make
it a target.

6 years agoCleaned up the tests/ folder
Loup Vaillant [Mon, 21 Oct 2019 12:57:03 +0000 (14:57 +0200)]
Cleaned up the tests/ folder

Just moving files around so it's better organised.

Also changed the vectors.h header a little:
- It now includes inttypes.h and and stddef.h only once.
- There's a note at the top saying where it comes from.

6 years agoTightened up the release script
Loup Vaillant [Sat, 19 Oct 2019 23:01:43 +0000 (01:01 +0200)]
Tightened up the release script

- Run tests/test.sh prior to release
- Removed the dist target from the shipped makefile
- Removed the contributor notes from the shipped README
- Don't include files that only serve to generate vectors.h
- Reworded some of README a little bit.

6 years agoRevert "Added version number to binaries"
Loup Vaillant [Sat, 19 Oct 2019 15:54:36 +0000 (17:54 +0200)]
Revert "Added version number to binaries"

This reverts commit 30737a99843ac9f33698ea7e06afae1e7c6133df.

Exposing version numbers in the binary can expose them to attackers.
Without the version number, they have to try the exploit and hope.  With
the version number, they may perform a cheap check before they proceed
any further.  Better not take the risk.

Furthermore, changing the length of the string may break ABI.  This will
happen if a version number (major, minor, or patch) ever reaches 10.

That patch was nice, but it potentially impact security and stability.
Not worth it in the end.

6 years agoRemoved spurious space
Loup Vaillant [Sat, 19 Oct 2019 15:44:04 +0000 (17:44 +0200)]
Removed spurious space

6 years agoHandle several "__git__" per line
Loup Vaillant [Sat, 19 Oct 2019 15:40:45 +0000 (17:40 +0200)]
Handle several "__git__" per line

6 years agoAdded version number to binaries
Loup Vaillant [Sat, 19 Oct 2019 13:14:48 +0000 (15:14 +0200)]
Added version number to binaries

Sometimes, we don't have the sources, and we want to check the version
number of the binaries themselves. (For instance when distributing
Monocypher as a library.)

To that end, I've added the global string constant "monocypher_version".
It can be used from the calling program, or scanned directly by tools.

6 years agoREADME nitpick
Loup Vaillant [Sat, 19 Oct 2019 13:03:34 +0000 (15:03 +0200)]
README nitpick

6 years agoInclude version in released source files
Loup Vaillant [Sat, 19 Oct 2019 12:44:28 +0000 (14:44 +0200)]
Include version in released source files

I realised that determining which Monocypher version was used in a
project was not trivial. We could look at Monocypher's code and deduce
the release, but that's tedious and error prone. So I've made those
versions more explicit:

- Source and header files begin by a comment describing the version.
- The pkg-config file created by `make install` include that version.
- The version number of unreleased code (under git) is "__git__"
- The version number of released code is whatever `git describe --tags`
  tells us.
- the "tarball" target in the makefile was changed to the more standard
  "dist".

To release a new version, we just add a tag, then call `makefile dist`.
The version of the released source file will appear at a glance, right
there on the first line.

Note: the release process blindly replaces all instances of "__git__" by
the suitable version number.  This could be used to version things other
than comments, like string constants.

6 years agoProperly ommit lib directory from tarball
Loup Vaillant [Sat, 19 Oct 2019 11:20:41 +0000 (13:20 +0200)]
Properly ommit lib directory from tarball

6 years agoCosmetic nitpick
Loup Vaillant [Thu, 17 Oct 2019 21:34:16 +0000 (23:34 +0200)]
Cosmetic nitpick

6 years agoMerge pull request #128 from fscoto/master+remove-kex-doc
Loup Vaillant [Fri, 18 Oct 2019 14:44:53 +0000 (16:44 +0200)]
Merge pull request #128 from fscoto/master+remove-kex-doc

Clean up kex documentation removal

6 years agoClean up kex documentation removal
Fabio Scotoni [Fri, 18 Oct 2019 12:14:20 +0000 (14:14 +0200)]
Clean up kex documentation removal

Related to git commit 6163d8195a3acf2e143d20843a602fd5fb7671d5.

6 years agoTidied up sliding windows, minor cosmetic nitpicks
Loup Vaillant [Wed, 16 Oct 2019 22:14:11 +0000 (00:14 +0200)]
Tidied up sliding windows, minor cosmetic nitpicks

Added `static` to the sliding window functions, reworked those functions
a bit to improve the (internal) API.  Simplified the double scalarmult
accordingly.

Added FOR_T macro, for when the index should be a type other than
size_t.  Helped remove explicit conversions in Argon2i and sliding
windows.  Hopefully this new macro will be obvious to reviewers.  I
could have used the regular `for` loop, but it took too much horizontal
space in Argon2i (we use long names there).

6 years agoCorrected some spelling mistakes
Loup Vaillant [Mon, 14 Oct 2019 09:16:59 +0000 (11:16 +0200)]
Corrected some spelling mistakes

6 years agoStart sliding windows at bit 252
Loup Vaillant [Mon, 14 Oct 2019 08:55:12 +0000 (10:55 +0200)]
Start sliding windows at bit 252

When performing the double scalar multiplication, bit 253, 254, and 255
are guaranteed to be zero.  No need to check them, we can start from
252.

Also added a comment warning about a possible off-by-one error.

6 years agoUpdated AUTHORS.md for EdDSA
Loup Vaillant [Sun, 13 Oct 2019 23:06:43 +0000 (01:06 +0200)]
Updated AUTHORS.md for EdDSA

The EdDSA code is now unrecognisable from what we saw in either SUPERCOP
and TweetNaCl.  Some significant pieces are still from ref10 or
TweetNaCl, but the overall structure is different enough that I should
consider myself the primary author...

...and clearly take responsibility for this code.

6 years agocrypto_check saves 32 more bytes of stack
Loup Vaillant [Mon, 7 Oct 2019 14:21:37 +0000 (16:21 +0200)]
crypto_check saves 32 more bytes of stack

6 years agoCosmetic arg shuffling
Loup Vaillant [Mon, 7 Oct 2019 13:56:50 +0000 (15:56 +0200)]
Cosmetic arg shuffling

6 years agoSaved 32 more bytes
Loup Vaillant [Sun, 6 Oct 2019 23:18:43 +0000 (01:18 +0200)]
Saved 32 more bytes

Also took care of Clang warnings in the process

6 years agoFused sliding windows and scalar multiplication
Loup Vaillant [Sun, 6 Oct 2019 22:45:05 +0000 (00:45 +0200)]
Fused sliding windows and scalar multiplication

At last, we saved some stack. 320 bytes on my machine, which is a bit
disappointing. We may be able to shave off a couple more, but we're
reaching the limit.

6 years agoIncremental left to right sliding windows
Loup Vaillant [Sun, 6 Oct 2019 21:58:38 +0000 (23:58 +0200)]
Incremental left to right sliding windows

The main loop of the scalar multiplication goes one by one, so we can't
have the sliding loop skip indices.  By adding a context that keeps
track of the next needed addition (as well as its value), we'll be able
to fuse the two slides and the scalar multiplication together.

6 years agoSlide from left to right
Loup Vaillant [Sun, 6 Oct 2019 20:12:42 +0000 (22:12 +0200)]
Slide from left to right

Scalar multiplication goes from left to right (from MSB to
LSB). Computing the sliding windows used to go from *right to left*.

This direction mismatch forced us to keep all the signed digits in
memory, which currently incur a little over 500 bytes of stack overhead.
That overhead is avoidable. Avoiding it will allow Monocypher to fit in
smaller embedded devices.

Right now we just change the direction of the sliding. Interleaving will
come later.

6 years agoCosmetic
Loup Vaillant [Sat, 5 Oct 2019 00:03:35 +0000 (02:03 +0200)]
Cosmetic

6 years agoRemoved kex documentation
Loup Vaillant [Fri, 4 Oct 2019 21:15:03 +0000 (23:15 +0200)]
Removed kex documentation

It will be corrected and added later, once we integrate the latest Monokex.

6 years agoCorrected C++ warning
Loup Vaillant [Sun, 29 Sep 2019 19:40:23 +0000 (21:40 +0200)]
Corrected C++ warning

6 years agoRemoved obsolete Monokex
Loup Vaillant [Sun, 29 Sep 2019 19:23:16 +0000 (21:23 +0200)]
Removed obsolete Monokex

That attempt had a crappy API, and was possibly insecure. Monokex has
since evolved significantly.

It will come back later, once we are sure everything is ironed out. In
the mean time, Monokex will ship separately.

6 years agoMissing variable time comment
Loup Vaillant [Sun, 29 Sep 2019 18:23:24 +0000 (20:23 +0200)]
Missing variable time comment

6 years agoignore QtCreator IDE files
Loup Vaillant [Sat, 28 Sep 2019 09:34:20 +0000 (11:34 +0200)]
ignore QtCreator IDE files

Assuming the project is called 'monocypher'.

6 years agoCorrected clang warnings
Loup Vaillant [Sat, 28 Sep 2019 09:30:47 +0000 (11:30 +0200)]
Corrected clang warnings

Those are easily visible through the QtCreator IDE intellisense, but
somehow never showed up when compiling at the command line.  This should
help silence MSVC warnings as well.

6 years agoHoisted negations out of loops
Loup Vaillant [Mon, 29 Jul 2019 22:43:35 +0000 (00:43 +0200)]
Hoisted negations out of loops

Turns out compilers don't do this naturally, and this leads to
observable slow downs in some cases.

Also noted that we are relying on 2's complement representation (we
already were).  We could be more portable by going unsigned, but by this
logic the entire field arithmetic should go unsigned.  It's possible,
but it's not trivial.  I've kinda tried it in the past, and failed.

Every architecture of interest is 2's complement anyway, so I think this
will be good enough.

6 years agoMoved trim_scalar() and scalar_bits() up a slot
Loup Vaillant [Mon, 29 Jul 2019 22:30:22 +0000 (00:30 +0200)]
Moved trim_scalar() and scalar_bits() up a slot

Those functions are used for both X25519 and EdDSA. Moving them up one
section makes it easier for user to delete the X-25519 section without
affecting EdDSA.

(Overall, Monocypher should let users delete the code they don't
need. This wasn't an explicit goal initially, but the code naturally
turned out that way.  Supporting this use case cost us nothing.)

6 years agoCosmetic
Loup Vaillant [Mon, 29 Jul 2019 22:28:03 +0000 (00:28 +0200)]
Cosmetic

6 years agoSaved 40 bytes of stack for EdDSA signing
Loup Vaillant [Sun, 28 Jul 2019 11:40:01 +0000 (13:40 +0200)]
Saved 40 bytes of stack for EdDSA signing

6 years agoSave some more stack
Loup Vaillant [Thu, 25 Jul 2019 09:23:55 +0000 (11:23 +0200)]
Save some more stack

6 years agoAdded X25519 Whycheproof test vectors
Loup Vaillant [Thu, 25 Jul 2019 06:49:16 +0000 (08:49 +0200)]
Added X25519 Whycheproof test vectors

6 years agoMinor cleanups
Loup Vaillant [Thu, 27 Jun 2019 20:36:23 +0000 (22:36 +0200)]
Minor cleanups

Multiplications by powers of two are supposed to be shifts.
It was not clear how we were ignoring the MSB of curve25519 points.

6 years agoWorked around TIS interpreter volatile bug
Loup Vaillant [Thu, 30 May 2019 22:33:54 +0000 (00:33 +0200)]
Worked around TIS interpreter volatile bug

6 years agoCorrected wrong man page redirection
Loup Vaillant [Tue, 28 May 2019 13:19:44 +0000 (15:19 +0200)]
Corrected wrong man page redirection

6 years agoFixed TweetNaCl speed tests
Loup Vaillant [Mon, 13 May 2019 21:26:26 +0000 (23:26 +0200)]
Fixed TweetNaCl speed tests

6 years agoMerge pull request #125 from fscoto/master
Loup Vaillant [Wed, 17 Apr 2019 06:15:40 +0000 (08:15 +0200)]
Merge pull request #125 from fscoto/master

Document BLAKE2 RFC

6 years agoDocument BLAKE2 RFC
Fabio Scotoni [Wed, 17 Apr 2019 04:19:38 +0000 (06:19 +0200)]
Document BLAKE2 RFC

7 years agoMerge pull request #124 from fscoto/master
Loup Vaillant [Thu, 4 Apr 2019 20:48:49 +0000 (22:48 +0200)]
Merge pull request #124 from fscoto/master

README: nitpicks

7 years agoREADME: nitpick: make links HTTPS where possible
Fabio Scotoni [Thu, 4 Apr 2019 13:11:55 +0000 (15:11 +0200)]
README: nitpick: make links HTTPS where possible

7 years agoREADME: nitpick: missing colon
Fabio Scotoni [Thu, 4 Apr 2019 11:05:36 +0000 (13:05 +0200)]
README: nitpick: missing colon

Options 1 and 2 had colons after them, but option 3 didn't.

7 years agoMerge pull request #123 from fscoto/master
Loup Vaillant [Thu, 4 Apr 2019 06:27:55 +0000 (08:27 +0200)]
Merge pull request #123 from fscoto/master

manual: roff formatting fixes

7 years agomanual: roff formatting fixes
Fabio Scotoni [Thu, 4 Apr 2019 04:22:04 +0000 (06:22 +0200)]
manual: roff formatting fixes

7 years agoMerge pull request #122 from fscoto/master
Loup Vaillant [Wed, 3 Apr 2019 20:21:40 +0000 (22:21 +0200)]
Merge pull request #122 from fscoto/master

Add HISTORY sections

7 years agomanual: Address HISTORY review concerns
Fabio Scotoni [Wed, 3 Apr 2019 17:06:23 +0000 (19:06 +0200)]
manual: Address HISTORY review concerns

7 years agoAdd HISTORY sections
Fabio Scotoni [Wed, 3 Apr 2019 04:08:25 +0000 (06:08 +0200)]
Add HISTORY sections

7 years agoClarified installation instructions
Loup Vaillant [Tue, 2 Apr 2019 20:59:56 +0000 (22:59 +0200)]
Clarified installation instructions

Related to #120

Made the 3 options (from source, from lib, system wide installation)
clearer, and stated the ability to change compilation flags explicitly.
(Those flags are all standards, but not everyone may know them).

7 years agoMerge pull request #121 from fscoto/master
Loup Vaillant [Tue, 2 Apr 2019 20:32:47 +0000 (22:32 +0200)]
Merge pull request #121 from fscoto/master

makefile: switch from $() to backticks

7 years agomakefile: switch from $() to backticks
Fabio Scotoni [Tue, 2 Apr 2019 11:03:03 +0000 (13:03 +0200)]
makefile: switch from $() to backticks

This fixes building with gmake on Solaris 10,
and likely some other platforms with /bin/sh before POSIX standardized
$() for command substitution.

Addresses issue #120.

7 years agoEdit nipick
Loup Vaillant [Sun, 31 Mar 2019 16:26:09 +0000 (18:26 +0200)]
Edit nipick

7 years agoMerge pull request #119 from fscoto/master
Loup Vaillant [Sun, 31 Mar 2019 13:18:14 +0000 (15:18 +0200)]
Merge pull request #119 from fscoto/master

Update manual with variable changes

7 years agocrypto_kex_{x,xk1} man pages: address review
Fabio Scotoni [Sun, 31 Mar 2019 12:57:26 +0000 (14:57 +0200)]
crypto_kex_{x,xk1} man pages: address review

7 years agoBetter represent Fabio Scotoni's involvment
Loup Vaillant [Sun, 31 Mar 2019 12:03:10 +0000 (14:03 +0200)]
Better represent Fabio Scotoni's involvment

7 years agoUpdate manual with variable changes
Fabio Scotoni [Sat, 30 Mar 2019 19:55:25 +0000 (20:55 +0100)]
Update manual with variable changes

Also pulls the descriptions of the arguments to the front,
which makes them easier to discern.

7 years agoFixed variable shadowing
Loup Vaillant [Sat, 23 Mar 2019 11:14:19 +0000 (12:14 +0100)]
Fixed variable shadowing

7 years agoOptimised Poly1305 loading code
Loup Vaillant [Fri, 22 Mar 2019 20:52:30 +0000 (21:52 +0100)]
Optimised Poly1305 loading code

By actually *rolling* the loading code.  I haven't looked at the
assembly, but I suspect the loop is easier for the compiler to
vectorise.

This results in a 5% speed increase on my machine (Intel i5 Skylake
laptop, gcc 7.3.0).

This fix was made possible by @Sadoon-AlBader on GitHub, who submitted
pull request #118

7 years agoClarified why some buffers are not wiped
Loup Vaillant [Thu, 14 Mar 2019 22:45:44 +0000 (23:45 +0100)]
Clarified why some buffers are not wiped

ge_msub() and ge_double_scalarmult_vartime() aren't clear why they don't
wipe their buffers.  I have added warnings that they indeed don't do so,
and thus should not be used to process secrets.

This also makes clear to auditors that failing to wipe the buffers was
intentional.

7 years agoArgon2 salts are at least 8 bytes
Loup Vaillant [Thu, 14 Mar 2019 22:44:55 +0000 (23:44 +0100)]
Argon2 salts are at least 8 bytes

7 years agoImproved the key exchange API
Loup Vaillant [Wed, 13 Mar 2019 23:10:26 +0000 (00:10 +0100)]
Improved the key exchange API

crypto_kex_ctx is now differentiated into a client specific context, and
a server specific context.  The distinction is entirely artificial (it's
the same thing under the hood), but it prevents some misuses at compile
time, making the API easier to use.

The name of the arguments have also been changed: "local" and "remote"
have been replaced by "client" and "server" whenever appropriate.  The
previous names made implementation easier, but their meaning was context
dependent, and thus confusing. The new names have stable meanings, and
thus easier to document and use.

TODO: update the manual to reflect those changes.

7 years agoMerge pull request #117 from fscoto/master
Loup Vaillant [Tue, 12 Mar 2019 07:14:04 +0000 (08:14 +0100)]
Merge pull request #117 from fscoto/master

man: fix whitespace and macro invocation issues

7 years agoman: fix whitespace and macro invocation issues
Fabio Scotoni [Tue, 12 Mar 2019 06:17:39 +0000 (07:17 +0100)]
man: fix whitespace and macro invocation issues

- There was some trailing whitespace on some of the lines of the new
  pages that I hadn't noticed.
- There was a .PP instead of .Pp.
- There was a .Fa with no space after it.

7 years agoMerge pull request #116 from fscoto/master
Loup Vaillant [Sun, 10 Mar 2019 17:04:55 +0000 (18:04 +0100)]
Merge pull request #116 from fscoto/master

LICENCE: update copyright year

7 years agoLICENCE: update copyright year
Fabio Scotoni [Sat, 9 Mar 2019 15:12:52 +0000 (16:12 +0100)]
LICENCE: update copyright year

Changes have been made since 2017.

7 years agoMerge pull request #115 from fscoto/master
Loup Vaillant [Thu, 7 Mar 2019 18:47:46 +0000 (19:47 +0100)]
Merge pull request #115 from fscoto/master

Add kex man pages

7 years agoAmerican -> British
Fabio Scotoni [Thu, 7 Mar 2019 10:24:35 +0000 (11:24 +0100)]
American -> British

7 years agoAddress points brought up by @LoupVaillant in review
Fabio Scotoni [Thu, 7 Mar 2019 09:48:35 +0000 (10:48 +0100)]
Address points brought up by @LoupVaillant in review

7 years agoAdd kex man pages
Fabio Scotoni [Wed, 6 Mar 2019 14:29:56 +0000 (15:29 +0100)]
Add kex man pages

7 years agoCorrected undefined behaviour in kex tests
Loup Vaillant [Mon, 4 Mar 2019 22:20:28 +0000 (23:20 +0100)]
Corrected undefined behaviour in kex tests

Calling those functions again on the same status not only does not make
any sense, it can grow the transcript beyond its maximum size of 128
bytes, which triggers a buffer overflow.  We needed to save the context
so we could re-run the relevant function where we left of.

It's the second time the TIS interpreter finds a bug that the other
sanitisers didn't.

7 years agoAdded secure channel protocols (experimental)
Loup Vaillant [Sun, 3 Mar 2019 21:56:29 +0000 (22:56 +0100)]
Added secure channel protocols (experimental)

At long last, the NaCl family of crypto libraries is gaining direct
support for secure channels.

Up until now, the choices were basically invent our own protocol, or
give up and use a TLS library, thus voiding the usability improvements
of NaCl libraries.

Now we have a solution.  It's still a bit experimental, it's not yet
documented, but it's there.  And soon, we will finally be able to shift
the cryptographic right answer for secure channels away from TLS, and
towards the NaCl family.  Or perhaps just Monocypher, if for some reason
Libsodium doesn't follow suit. :-)

7 years agoBuild: allow overwriting of symbolic link
Loup Vaillant [Sat, 2 Mar 2019 17:01:40 +0000 (18:01 +0100)]
Build: allow overwriting of symbolic link

7 years agoMore RFC number corrections
Loup Vaillant [Sun, 24 Feb 2019 08:33:35 +0000 (09:33 +0100)]
More RFC number corrections

RFC 7539 has been obsoleted by RFC 8439.
Incremental EdDSA didn't change to RFC 8032.

7 years agoCorrected RFC number in EdDSA manual
Loup Vaillant [Sat, 23 Feb 2019 19:47:56 +0000 (20:47 +0100)]
Corrected RFC number in EdDSA manual

7 years agoClarified Argon2 allocation in the manual
Loup Vaillant [Sat, 23 Feb 2019 19:32:44 +0000 (20:32 +0100)]
Clarified Argon2 allocation in the manual

7 years agoAdded comment on speed tests
Loup Vaillant [Fri, 22 Feb 2019 20:14:06 +0000 (21:14 +0100)]
Added comment on speed tests

The way I measure timings is not perfectly portable. Users who
get weird results are encouraged to modify this bit of code to
have proper measurements.

7 years agoFixed speed-sodium build
Loup Vaillant [Fri, 22 Feb 2019 07:53:32 +0000 (08:53 +0100)]
Fixed speed-sodium build

7 years agoRemoved division by zero in speed benchmarks
Loup Vaillant [Sun, 17 Feb 2019 18:25:52 +0000 (19:25 +0100)]
Removed division by zero in speed benchmarks

If some library is so fast that it goes below the resolution of the
timer we're using to measure it, the measured duration may be zero, and
then trigger a division by zero when we convert it to a speed in Hz.

This could possibly happen with a very fast library (Libsodium), on a
very fast machine, with a sufficiently low resolution timer.

This patch reworks and simplifies things a bit, and adds an explicit
check. We now print "too fast to be measured" instead of dividing by
zero.

7 years agoDocumentation typo
Loup Vaillant [Fri, 15 Feb 2019 07:29:49 +0000 (08:29 +0100)]
Documentation typo

7 years agoWrong array size in function argument
Loup Vaillant [Sun, 3 Feb 2019 10:59:02 +0000 (11:59 +0100)]
Wrong array size in function argument

Fixes #114

Most proably harmless, but nevertheless ugly.