]> git.codecow.com Git - Monocypher.git/log
Monocypher.git
6 years agoElligator script: hoisted constant out
Loup Vaillant [Mon, 24 Feb 2020 00:06:12 +0000 (01:06 +0100)]
Elligator script: hoisted constant out

6 years agoElligator script: added explicit curve to hash
Loup Vaillant [Sun, 23 Feb 2020 23:39:41 +0000 (00:39 +0100)]
Elligator script: added explicit curve to hash

Now we can finally begin the C implementation, which should be a
straightforward transliteration of the Python code.

6 years agoMan page: fixed const in code example
Loup Vaillant [Sun, 23 Feb 2020 15:45:43 +0000 (16:45 +0100)]
Man page: fixed const in code example

6 years agoElligator script: whitespace nitpick
Loup Vaillant [Sun, 23 Feb 2020 14:52:00 +0000 (15:52 +0100)]
Elligator script: whitespace nitpick

6 years agoAdded Elligator to vector generation
Loup Vaillant [Sun, 23 Feb 2020 14:51:16 +0000 (15:51 +0100)]
Added Elligator to vector generation

6 years agovector_to_header now handles leading empty lines
Loup Vaillant [Sun, 23 Feb 2020 14:50:23 +0000 (15:50 +0100)]
vector_to_header now handles leading empty lines

6 years agoREADME.md: fixed test dir path
Loup Vaillant [Sun, 23 Feb 2020 14:32:50 +0000 (15:32 +0100)]
README.md: fixed test dir path

6 years agoElligator script: ordering nitpick
Loup Vaillant [Sun, 23 Feb 2020 14:23:42 +0000 (15:23 +0100)]
Elligator script: ordering nitpick

6 years agoElligator script: take vectors from stdin
Loup Vaillant [Sun, 23 Feb 2020 11:12:15 +0000 (12:12 +0100)]
Elligator script: take vectors from stdin

6 years agoElligator script: added fast_curve_to_hash
Loup Vaillant [Sun, 23 Feb 2020 11:05:32 +0000 (12:05 +0100)]
Elligator script: added fast_curve_to_hash

6 years agoElligator script: test explicit_hash_to_curve
Loup Vaillant [Sun, 23 Feb 2020 10:46:27 +0000 (11:46 +0100)]
Elligator script: test explicit_hash_to_curve

6 years agoElligator script: remove redundant test
Loup Vaillant [Sun, 23 Feb 2020 10:41:04 +0000 (11:41 +0100)]
Elligator script: remove redundant test

6 years agoElligator script: test fast_scalarbase
Loup Vaillant [Sun, 23 Feb 2020 10:37:46 +0000 (11:37 +0100)]
Elligator script: test fast_scalarbase

6 years agoElligator script: moved final tests
Loup Vaillant [Sun, 23 Feb 2020 10:29:05 +0000 (11:29 +0100)]
Elligator script: moved final tests

6 years agoElligator script: naming nitpick
Loup Vaillant [Sun, 23 Feb 2020 09:44:44 +0000 (10:44 +0100)]
Elligator script: naming nitpick

6 years agoElligator script: use x25519_pk test vectors
Loup Vaillant [Fri, 21 Feb 2020 22:17:29 +0000 (23:17 +0100)]
Elligator script: use x25519_pk test vectors

We're now reading the `x25519_pk.all.vec` generated by Libsodium in
`x25519.c`, to make sure scalarmult is correctly implemented in the
Python script.

While we're at it, we also use them to generate Elligator 2 vectors.
Any addition to the X25519 public key generation will automatically
benefit Elligator 2 as well

TODO: update the makefile to make sure the vectors are generated before
we run `elligator.py`

6 years agoElligator script: avoid redundant computaton
Loup Vaillant [Fri, 21 Feb 2020 21:07:55 +0000 (22:07 +0100)]
Elligator script: avoid redundant computaton

6 years agoElligator script: added fast_from_edwards
Loup Vaillant [Thu, 20 Feb 2020 23:21:21 +0000 (00:21 +0100)]
Elligator script: added fast_from_edwards

6 years agoElligator script: readability nitpick
Loup Vaillant [Thu, 20 Feb 2020 23:06:40 +0000 (00:06 +0100)]
Elligator script: readability nitpick

The can_curve_to_hash() test takes a Montgomery point as input, whose
coordinates are generally called (u, v), not (x, y).

6 years agoElligator script: removed erroneous .abs()
Loup Vaillant [Thu, 20 Feb 2020 23:00:44 +0000 (00:00 +0100)]
Elligator script: removed erroneous .abs()

Changing the sign of the v coordinate had an effect on the final value
of the final hash, but wasn't detected because my initial tests only
compare to the u coordinate, which appears to be correct.

This doesn't affect the success or failure of the Elligator mapping,
which only look at the u coordinate.  Yet another example of incorrect
crypto that looks like it works...

6 years agoElligator 2 script: fast scalarmult, explicit hash_to_curve
Loup Vaillant [Wed, 19 Feb 2020 22:51:12 +0000 (23:51 +0100)]
Elligator 2 script: fast scalarmult, explicit hash_to_curve

The fast scalar multiplication will let us explore the merging of the
various exponentiations required to perform the conversion to Montgomery
then curve_to_hash.

The explicit hash_to_curve() serves as an implementation guide.  Note
the omission of the v coordinate, not needed for X25519.  I am not
aware of a compelling use case to convert to Edwards (not all PAKEs need
point addition).

6 years agoAdded the fe (field element) type for readability
Loup Vaillant [Wed, 19 Feb 2020 20:30:47 +0000 (21:30 +0100)]
Added the fe (field element) type for readability

Having to write those modulo operators everywhere was tiresome. Having
an explicit field element type allows a more direct writing. It also
helps Python throw type errors if we misuse anything.

6 years agoPortability nitpick
Loup Vaillant [Tue, 18 Feb 2020 17:26:38 +0000 (18:26 +0100)]
Portability nitpick

6 years agoUse pow() for exponentiation in Python 3
Loup Vaillant [Tue, 18 Feb 2020 17:25:11 +0000 (18:25 +0100)]
Use pow() for exponentiation in Python 3

Much faster this way.

6 years agoSimplified elligator scripts a bit
Loup Vaillant [Mon, 17 Feb 2020 23:36:52 +0000 (00:36 +0100)]
Simplified elligator scripts a bit

6 years agoAdd license to elligator script
Loup Vaillant [Mon, 17 Feb 2020 23:15:55 +0000 (00:15 +0100)]
Add license to elligator script

6 years agoPorted SAGE script to Python3
Loup Vaillant [Mon, 17 Feb 2020 23:03:29 +0000 (00:03 +0100)]
Ported SAGE script to Python3

Turned out SAGE wasn't really needed. Python already has all we need,
and the differences are minimal.  Cryptographers will be able to read
the Python code as easily as SAGE.

The disadvantage is that Python3's arithmetic is twice as slow.
The advantage is that Python3 is ubiquitous, and can reasonably be
required to generate test vectors.

6 years agoSAGE script: use (and fix) scalarbase
Loup Vaillant [Mon, 17 Feb 2020 16:24:10 +0000 (17:24 +0100)]
SAGE script: use (and fix) scalarbase

6 years agoSAGE script: removed dead code
Loup Vaillant [Mon, 17 Feb 2020 16:21:21 +0000 (17:21 +0100)]
SAGE script: removed dead code

6 years agoPython 3 compatible print calls for SAGE
Loup Vaillant [Mon, 17 Feb 2020 10:41:22 +0000 (11:41 +0100)]
Python 3 compatible print calls for SAGE

6 years agoAdded Elligator2 SAGE script
Loup Vaillant [Sun, 16 Feb 2020 23:25:24 +0000 (00:25 +0100)]
Added Elligator2 SAGE script

That script prints test vectors to the standard output, in the following
order:

- private key
- public key (X coordinate)
- public key (Y coordinate, never exposed by Monocypher)
- Boolean (0 if we can't convert, 1 if we can)
- hash of the public key (or zero if we couldn't convert)

I could use that script to generate the test vectors automatically, but
I hesitate to introduce a hard dependency on SAGE.

The alternative is to put the test vectors themselves under version
control.  We could add a target to the makefile that checks whether the
test vectors and the script are in sync, but that would break if we end
up adding vectors manually (which typically happens whenever project
Whycheproof publishes new vectors).

6 years agoRemoved modulo operation in SHA-512
Loup Vaillant [Fri, 14 Feb 2020 23:27:25 +0000 (00:27 +0100)]
Removed modulo operation in SHA-512

While I expect almost all compilers optimise those down to a bit mask in
practice, it can help naive compilers generate better code. The rest of
Monocypher already took this approach, I just forgot about this one.

6 years agoRemoved 64-bit modulo operation in Argon2i
Loup Vaillant [Fri, 14 Feb 2020 23:16:45 +0000 (00:16 +0100)]
Removed 64-bit modulo operation in Argon2i

Fixes #156

This modulo operation is implemented on software in many 32-bits
processors, such as the Cortex-M3.  This causes the generated binary to
depend a standard library routine that is often not present on such
small machines.  This hurts portability and convenience.

Thankfully, this particular modulo is not needed, and can be replaced by
a simple test and subtraction. This is not constant time, but we don't
care: the index we are computing does not depend on any secret, so a
variable timing won't expose anything.

Performance seems to very slightly increase on x86-64. 32-bit machines
may benefit more.

6 years agoRemoved unnecesary period in HMAC manual
Loup Vaillant [Wed, 12 Feb 2020 21:56:33 +0000 (22:56 +0100)]
Removed unnecesary period in HMAC manual

6 years agoAdded warning in the Git version of the README
Loup Vaillant [Sat, 8 Feb 2020 17:23:51 +0000 (18:23 +0100)]
Added warning in the Git version of the README

I noticed that some careless hurried people tend to use Monocypher from
the git repository directly. They don't even grab the releases from
GitHub.  That's not ideal for two reasons:

1. The master branch isn't always stable.
2. The Git repository misses some automatically generated files.

This patch attempts to get end users away from the Git repository,
towards well tested official releases.  Also, for users who think the
tarball are binary releases (they're source releases), or just want to
be done as quickly as possible, I also gave direct links to the main
source and header files.

6 years agoMinor man page nitipick
Loup Vaillant [Sat, 8 Feb 2020 16:04:15 +0000 (17:04 +0100)]
Minor man page nitipick

6 years agoMerge pull request #155 from fscoto/master+pwhash-doc
Loup Vaillant [Thu, 6 Feb 2020 21:30:17 +0000 (22:30 +0100)]
Merge pull request #155 from fscoto/master+pwhash-doc

Be more explicit about passwords in man pages

6 years agopw hashing: clarify that hash functions can hash
Fabio Scotoni [Thu, 6 Feb 2020 13:08:29 +0000 (14:08 +0100)]
pw hashing: clarify that hash functions can hash

Misleading wording spotted by @aggsol as part of review of #155.

6 years agoBe more explicit about passwords in man pages
Fabio Scotoni [Wed, 5 Feb 2020 18:51:09 +0000 (19:51 +0100)]
Be more explicit about passwords in man pages

Prompted by an inquiry in #154.

6 years agoImproved readability of EdDSA verification
Loup Vaillant [Fri, 24 Jan 2020 21:19:32 +0000 (22:19 +0100)]
Improved readability of EdDSA verification

Basically, we separated the computation of R_check from the verification
that it is equal to R. The computation of R_check takes s, h_ram and the
public key as parameter, and output R_check.

The primary advantage is a better separation of concerns, which makes
the code more readable in my opinion.

A secondary advantage is that we could now test ge_r_check() separately,
with arbitrary values of s and h_ram.  This lets us test difficult to
trigger edge cases, like having s or h_ram exceeding 2^252, and is just
plain more general than only testing valid and invalid signatures.

I very much like this secondary advantage, because EdDSA is to this day
the part of Monocypher that makes me the most nervous.

6 years agoEasier to use ge_madd() and ge_msub()
Loup Vaillant [Thu, 23 Jan 2020 22:27:47 +0000 (23:27 +0100)]
Easier to use ge_madd() and ge_msub()

There are two main changes:

1. ge_madd() and ge_msub() now take a ge_precomp as second argument.
2. ge_msub() can now process secrets.

The pre-computed table have been adjusted accordingly. They're now
arrays of ge_precomp instead of being multiple arrays of fe.

We can also expect a (mostly negligible) performance increase:

- The new tables have slightly better locality.
- ge_msub() is the mirror of ge_madd() instead of using it.
- Using ge_msub() for signatures is now slightly more direct.

6 years agoCorrected changelog (IETF Chacha20)
Loup Vaillant [Wed, 22 Jan 2020 07:13:44 +0000 (08:13 +0100)]
Corrected changelog (IETF Chacha20)

Can't correct the tarball itself (that's a hash set in stone), but the
repository and Github releases can be changed, at least.

6 years agovector_to_header did not return 0
Loup Vaillant [Mon, 20 Jan 2020 20:09:31 +0000 (21:09 +0100)]
vector_to_header did not return 0

6 years agoUpdate Changelog date
Loup Vaillant [Sun, 19 Jan 2020 15:38:40 +0000 (16:38 +0100)]
Update Changelog date

6 years agoMerge pull request #151 from fscoto/master+comments
Loup Vaillant [Wed, 15 Jan 2020 18:20:06 +0000 (19:20 +0100)]
Merge pull request #151 from fscoto/master+comments

Add some comments about what the EC functions do

6 years agoAdd some comments about what the EC functions do
Fabio Scotoni [Wed, 15 Jan 2020 12:50:09 +0000 (13:50 +0100)]
Add some comments about what the EC functions do

This hopefully helps both auditing the code (by giving a clear
indication of what a function is supposed to be doing),
and trying to work with it (by minimizing the amount of time people need
to determine if a function is relevant to their interests).

6 years agoBump copyright year (again)
Loup Vaillant [Tue, 14 Jan 2020 21:00:24 +0000 (22:00 +0100)]
Bump copyright year (again)

6 years agoBump copyright year
Loup Vaillant [Mon, 13 Jan 2020 22:54:26 +0000 (23:54 +0100)]
Bump copyright year

6 years agoFixed missing wipe
Loup Vaillant [Sat, 11 Jan 2020 13:44:58 +0000 (14:44 +0100)]
Fixed missing wipe

And a few cosmetics

6 years agoRemoved unnecessary wipe
Loup Vaillant [Sat, 11 Jan 2020 13:24:10 +0000 (14:24 +0100)]
Removed unnecessary wipe

6 years agoCosmetic/consistency in Argon2i
Loup Vaillant [Sat, 11 Jan 2020 12:59:09 +0000 (13:59 +0100)]
Cosmetic/consistency in Argon2i

The functions g_copy() and g_xor() both take a pointer to a temporary,
to avoid wiping them again and again. unary_g(), however, did not, and
instead managed its temporary block internally.

Since unary_g() is called less often, this is not really a problem. I
thought it would be cleaner however to have all three functions work the
same way.

This should have a negligible, positive impact on performance as well.

6 years agoMerge pull request #150 from fscoto/master+shhead
Loup Vaillant [Sat, 11 Jan 2020 11:01:41 +0000 (12:01 +0100)]
Merge pull request #150 from fscoto/master+shhead

dist.sh: Forgot copyright header for myself

6 years agoMerge pull request #149 from fscoto/master+custom-hash
Loup Vaillant [Sat, 11 Jan 2020 10:51:05 +0000 (11:51 +0100)]
Merge pull request #149 from fscoto/master+custom-hash

doc: custom hash: clean up C-only-isms

6 years agodoc: custom hash: clean up C-only-isms
Fabio Scotoni [Sat, 11 Jan 2020 06:30:43 +0000 (07:30 +0100)]
doc: custom hash: clean up C-only-isms

Related to e1520e87d.

6 years agoAdded Wycheproof HMAC-SHA512 test vectors
Loup Vaillant [Wed, 8 Jan 2020 22:17:52 +0000 (23:17 +0100)]
Added Wycheproof HMAC-SHA512 test vectors

Only 64-byte tags.  Monocypher does not support shorter tags

6 years agoFixed C++ compilation
Loup Vaillant [Wed, 8 Jan 2020 22:03:55 +0000 (23:03 +0100)]
Fixed C++ compilation

Fixes #148

C++ is less lenient than C with its casts. It requires the pointers to
be cast to the correct type, `void*` alone does not work.

TODO: we should probably fix the documentation as well.

6 years agoRolled loop for zero initialisation
Loup Vaillant [Sun, 5 Jan 2020 20:32:41 +0000 (21:32 +0100)]
Rolled loop for zero initialisation

- Compilers optimise loops better.
- We save one line of code this way.

(This is a nitpick: in practice, this doesn't change a thing.)

6 years agoMerge pull request #145 from fscoto/master+custom-hash
Loup Vaillant [Sun, 5 Jan 2020 18:28:26 +0000 (19:28 +0100)]
Merge pull request #145 from fscoto/master+custom-hash

doc: use static key for custom hash example

6 years agoMerge pull request #147 from mikejsavage/examplesfixes
Loup Vaillant [Sun, 5 Jan 2020 18:15:36 +0000 (19:15 +0100)]
Merge pull request #147 from mikejsavage/examplesfixes

Some examples fixes

6 years agoMerge pull request #146 from mikejsavage/man2csh
Loup Vaillant [Sun, 5 Jan 2020 18:13:55 +0000 (19:13 +0100)]
Merge pull request #146 from mikejsavage/man2csh

Rewrite example test script in shell

6 years agoFix license
Michael Savage [Sun, 29 Dec 2019 10:45:46 +0000 (12:45 +0200)]
Fix license

6 years agoreturn 0
Michael Savage [Sat, 28 Dec 2019 23:54:32 +0000 (01:54 +0200)]
return 0

6 years agoMatch man2html.sh style
Michael Savage [Sat, 28 Dec 2019 23:51:33 +0000 (01:51 +0200)]
Match man2html.sh style

6 years agoQuotes, use cat so the sed train runs strictly left to right
Michael Savage [Sat, 28 Dec 2019 23:47:39 +0000 (01:47 +0200)]
Quotes, use cat so the sed train runs strictly left to right

6 years agodist_ignore extract_examples.sh
Michael Savage [Sat, 28 Dec 2019 23:34:47 +0000 (01:34 +0200)]
dist_ignore extract_examples.sh

6 years agoReview changes
Michael Savage [Sat, 28 Dec 2019 14:59:03 +0000 (16:59 +0200)]
Review changes

6 years agodist.sh: Forgot copyright header for myself
Fabio Scotoni [Sat, 28 Dec 2019 14:05:14 +0000 (15:05 +0100)]
dist.sh: Forgot copyright header for myself

Was just a one-line find(1) change, so one could argue removal of me in
the CC-0 header would've been cleaner,
but Loup wanted me to take credit for it (e-mail of Oct 21, 2019).

6 years agoSome examples fixes
Michael Savage [Sat, 28 Dec 2019 11:54:38 +0000 (13:54 +0200)]
Some examples fixes

6 years agoWhoops
Michael Savage [Sat, 28 Dec 2019 11:58:30 +0000 (13:58 +0200)]
Whoops

6 years agoRewrite example test script in shell
Michael Savage [Sat, 28 Dec 2019 11:53:34 +0000 (13:53 +0200)]
Rewrite example test script in shell

6 years agodoc: use static key for custom hash example
Fabio Scotoni [Sat, 28 Dec 2019 07:03:30 +0000 (08:03 +0100)]
doc: use static key for custom hash example

Removes the non-portable arc4random(3) at least.
Still depends on the non-portable OpenBSD SHA-2 functions.

While there, fix CC-0 header to match reality.

6 years agoMerge pull request #144 from mikejsavage/testexamples
Loup Vaillant [Fri, 27 Dec 2019 23:51:58 +0000 (00:51 +0100)]
Merge pull request #144 from mikejsavage/testexamples

Add a script to extract examples from man pages

6 years agoAdd a script to extract examples from man pages
Michael Savage [Fri, 27 Dec 2019 16:47:47 +0000 (18:47 +0200)]
Add a script to extract examples from man pages

6 years agoTypo
Loup Vaillant [Mon, 23 Dec 2019 15:46:14 +0000 (16:46 +0100)]
Typo

6 years agoMerge pull request #143 from fscoto/master+licensing3
Loup Vaillant [Mon, 23 Dec 2019 15:44:23 +0000 (16:44 +0100)]
Merge pull request #143 from fscoto/master+licensing3

License clarifications

6 years agoLICENCE.md: Clarifications
Fabio Scotoni [Fri, 13 Dec 2019 08:42:28 +0000 (09:42 +0100)]
LICENCE.md: Clarifications

                            !!! important !!!
     No change to the licensing situation of Monocypher is intended.
               These are meant to be clarifications only.

                No action is required on any user's part.
                           !!! /important !!!

These changes are highly delicate, so I feel obliged to give a detailed
explanation of each change.
(For my own sanity, I'll use U.S. spelling for "license",
even if the LICENCE.md is written in British English.)

---

"Monocypher is dual-licensed" -> "Monocypher as a whole is
dual-licensed"

This new wording matches the phrasing found in the top-level license
file of musl and mandoc, both of which are notable and fairly large
BSD-licensed projects.
The file headers added in an earlier commit are part of this:
The copyright notices are an *integral* part of the BSD 2-clause
license;
there has been no formal copyright assignment agreement,
so the copyright notices of all contributors who have made copyrightable
changes are really meant to be in all applicable files.

Pro forma it should be noted, however, that Michael Savage and I have
agreed to the LICENCE.md as it was before this commit by e-mail.

This makes no difference for everyone who's taken just the
monocypher.[ch] files and added those to their project because the
individual files' copyright notices for those two files match the
original LICENCE.md.
(And again, we don't *actually* care about compliance with the BSD
2-clause license from our end because we've waived copyright to the
greatest extent possible for CC-0, so the only ones who would actually
care live in your company's legal department.)

---

"Choose whichever you want" -> "Choose whichever you want from the two
licences listed below"

This change is mainly intended to clarify that you're not meant to
choose an *arbitrary* license, but rather one of the two below.
In practice, this should not matter because if you didn't choose the
2-clause BSD license, you chose CC-0, where copyright is maximally
waived anyway, which allows you to do whatever.

---

"The BSD licence serves as a fallback" -> "The BSD licence serves as a
fallback option"

This change clarifies that using the BSD 2-clause license is just an
option, to be exercised at the recipient's discretion,
without diluting the actual intent of placing Monocypher in the public
domain.

This matters because the CC-0 license *itself* has a section called
"Public License Fallback"; it is NOT the intent to replace section 3 of
CC-0 with a BSD 2-clause license.
The previous wording could, however, have been misconstrued like this
and thus could've butchered the very idea of using CC-0 in the first
place.

---

Added: "See the individual files for specific information about who
contributed to what file during which years.  See below for special
notes."

This text was inspired by mandoc's licensing document.
It is necessary because the "total" copyright notice differs from the
copyright notice that applies to individual files,
so per-file compliance with the 2-clause BSD license differs.

About the special notes, see the section immediately below.

---

I also added a section called "Special notes",
which notes that we're allowed to include the externals because they've
been placed in the public domain by their respective authors.
This should help some people who are very careful about copyright and
distribution rights when redistributing Monocypher as a whole,
as they'll know where to look and all the heavy lifting has already been
done for them.

---

There are a number of files without the headers affixed to them.
Doing so would clutter them (e.g. README.md, CHANGELOG.md, AUTHORS.md)
and bring no actual value.
LICENCE.md applies to them indirectly.

---

(Digressions:
There's probably an interesting relationship between CC-0 and BSD
2-clause to be determined where any contributor agreeing to place their
work under the CC-0 license technically permits relicensing under the
BSD 2-clause in any case with no attribution.
I kind of wonder if CC-0 and a BSD 2-clause license aren't inherently
mutually exclusive -- it's conceptually difficult to grant rights that
you're immediately waiving in the next section of the same document.
But github.com/nothings/stb seems to take a similar approach with
MIT/Unlicense, and that evidently seems to make lawyers happy, so who am
I to judge?
But let's ignore all of these technicalities and be upstanding citizens
of the free software world that provide as much legal certainty as they
can.)

6 years agostyle.css: Affix license header
Fabio Scotoni [Thu, 12 Dec 2019 10:49:26 +0000 (11:49 +0100)]
style.css: Affix license header

Upstream mandoc relicensed mandoc.css about a year ago
to place it in the public domain, making things easy here.

6 years agoAdd AUTHORS.md for externals
Fabio Scotoni [Thu, 12 Dec 2019 10:33:24 +0000 (11:33 +0100)]
Add AUTHORS.md for externals

6 years agoLicensing header additions
Fabio Scotoni [Thu, 12 Dec 2019 10:32:33 +0000 (11:32 +0100)]
Licensing header additions

+50 lines for every file.

The abbreviated CC0 license header was taken from the CC0 FAQ
(https://wiki.creativecommons.org/wiki/CC0_FAQ).

There's no commonly accepted way to shorten the 2-clause BSD license,
so it has to be copied in full every time.
The copyright notices are important for 2-clause BSD license,
so adding a reference to LICENCE.md was impractical.

While already there, affix a SPDX license identifier to all files.
This helps automated license identification programs along,
such as GitHub and scancode-toolkit.

License headers are useful to clarify what license conditions apply
to a particular file.

6 years agoExpunged Monokex test vectors
Loup Vaillant [Fri, 20 Dec 2019 11:54:39 +0000 (12:54 +0100)]
Expunged Monokex test vectors

Monokex is unlikely to be added to Monocypher in the near future, for
a couple reasons:

- It is a high level protocol, and Monocypher is fairly low level.
- It is not yet ready for production.
- It takes a significant amount of code.

Maybe it will be added later, but first, Monokex must focus on being its
own library, with Monocypher as a dependency. (We could also have a
version that uses Libsodium instead.)

6 years agoReintroduce "intro: format link with .Lk"
Loup Vaillant [Wed, 18 Dec 2019 23:11:22 +0000 (00:11 +0100)]
Reintroduce "intro: format link with .Lk"

This reverts commit 8089c0c3820cbcfe0f267e507cc18b4ffd057896.

The bug is groff's and Debian is working to fix it.  We don't need to
work around it anymore.

6 years agoRevert "Fixed typo in manual"
Loup Vaillant [Mon, 16 Dec 2019 09:03:59 +0000 (10:03 +0100)]
Revert "Fixed typo in manual"

This reverts commit 9e362871bea3850a657e36145f6d3d667e0c921c.

I didn't fixed anything, I was destroying a perfectly fine escape
sequence!  Lesson learned: Roff doesn't ignore escape sequences in code
snippets.

6 years agoFixed typo in manual
Loup Vaillant [Sun, 15 Dec 2019 23:09:34 +0000 (00:09 +0100)]
Fixed typo in manual

6 years agoMerge pull request #142 from fscoto/master+new-man
Loup Vaillant [Fri, 13 Dec 2019 13:16:33 +0000 (14:16 +0100)]
Merge pull request #142 from fscoto/master+new-man

Documentation: Remove vestiges of incremental AEAD

6 years agoDocumentation: Remove vestiges of incremental AEAD
Fabio Scotoni [Fri, 13 Dec 2019 08:59:06 +0000 (09:59 +0100)]
Documentation: Remove vestiges of incremental AEAD

6 years agoMerge pull request #141 from fscoto/master+new-man
Loup Vaillant [Thu, 12 Dec 2019 17:28:25 +0000 (18:28 +0100)]
Merge pull request #141 from fscoto/master+new-man

Revert "intro: format link with .Lk"

6 years agoMerge pull request #140 from fscoto/master+build
Loup Vaillant [Thu, 12 Dec 2019 17:26:52 +0000 (18:26 +0100)]
Merge pull request #140 from fscoto/master+build

Two minor build system improvements

6 years agoRevert "intro: format link with .Lk"
Fabio Scotoni [Thu, 12 Dec 2019 12:24:21 +0000 (13:24 +0100)]
Revert "intro: format link with .Lk"

This reverts commit df321b37cda1db5e8bd6fa76e4daf01ac087b865.

As it turns out,
groff (1.22.4) will spew complaints about the Lk formatting to stderr,
even though it's rendered perfectly fine.

6 years agomakefile: Add LIBDIR option
Fabio Scotoni [Thu, 12 Dec 2019 08:58:05 +0000 (09:58 +0100)]
makefile: Add LIBDIR option

This is useful for multiarch, where you may have the library
installed in a subdirectory of /usr/lib/,
e.g. /usr/lib/x86_64-linux-gnu/.
Debian and Ubuntu appear to make use of this extensively;
having this in the makefile will avoid hacks when doing multiarch.
Autotools has a similar feature (passing --libdir to configure).

6 years agomakefile: Honor LDFLAGS variable if given
Fabio Scotoni [Thu, 12 Dec 2019 08:48:36 +0000 (09:48 +0100)]
makefile: Honor LDFLAGS variable if given

This allows specifying e.g. hardening options like -Wl,-z,relro
for link-time options.
It *is* normally possible to add these to CFLAGS,
but LDFLAGS is the established way to do this and tooling expects
it to work.
See also POSIX on make(1), whose default rules use LDFLAGS.

6 years agoMoved TweetNaCl to its own folder
Loup Vaillant [Wed, 11 Dec 2019 22:08:16 +0000 (23:08 +0100)]
Moved TweetNaCl to its own folder

6 years agoTweaked dist.sh
Loup Vaillant [Tue, 10 Dec 2019 20:37:42 +0000 (21:37 +0100)]
Tweaked dist.sh

6 years agoMerge pull request #139 from fscoto/master+new-man
Loup Vaillant [Tue, 10 Dec 2019 17:45:15 +0000 (18:45 +0100)]
Merge pull request #139 from fscoto/master+new-man

Miscellaneous documentation fixes

6 years agoDocumentation: bump date for custom hash man pages
Fabio Scotoni [Tue, 10 Dec 2019 10:37:47 +0000 (11:37 +0100)]
Documentation: bump date for custom hash man pages

6 years agoCHANGELOG: Use correct path for optional files
Fabio Scotoni [Tue, 10 Dec 2019 10:29:21 +0000 (11:29 +0100)]
CHANGELOG: Use correct path for optional files

6 years agoMake custom hash length requirements more explicit
Fabio Scotoni [Tue, 10 Dec 2019 10:21:39 +0000 (11:21 +0100)]
Make custom hash length requirements more explicit

Related to 0074dfab1.

Also note that vtable->final must actually write the hash,
not only finalize the context.

6 years agoDocumentation: Minor wording improvment for custom hash functions
Fabio Scotoni [Tue, 10 Dec 2019 10:15:00 +0000 (11:15 +0100)]
Documentation: Minor wording improvment for custom hash functions

6 years agoVersion 3.0.0 change log
Loup Vaillant [Mon, 9 Dec 2019 16:23:22 +0000 (17:23 +0100)]
Version 3.0.0 change log

6 years agoFixed c25519 speed benchmark
Loup Vaillant [Mon, 9 Dec 2019 16:09:56 +0000 (17:09 +0100)]
Fixed c25519 speed benchmark

6 years agoConsistent naming with 'make dist'
Loup Vaillant [Mon, 9 Dec 2019 16:07:14 +0000 (17:07 +0100)]
Consistent naming with 'make dist'