]> git.codecow.com Git - Monocypher.git/log
Monocypher.git
8 years agoManual review: crypto_sign
Loup Vaillant [Sun, 5 Nov 2017 15:39:33 +0000 (16:39 +0100)]
Manual review: crypto_sign

8 years agoManual review: crypto_lock_init
Loup Vaillant [Sun, 5 Nov 2017 11:21:52 +0000 (12:21 +0100)]
Manual review: crypto_lock_init

8 years agoForgot to wipe a temporary buffer
Loup Vaillant [Fri, 3 Nov 2017 11:10:23 +0000 (12:10 +0100)]
Forgot to wipe a temporary buffer

8 years agoManual review: applying CuleX's advice
Loup Vaillant [Fri, 3 Nov 2017 09:46:25 +0000 (10:46 +0100)]
Manual review: applying CuleX's advice

8 years agoManual review: crypto_lock
Loup Vaillant [Fri, 3 Nov 2017 00:31:13 +0000 (01:31 +0100)]
Manual review: crypto_lock

8 years agoAutomatically wipe Argon2i work area
Loup Vaillant [Wed, 1 Nov 2017 20:07:14 +0000 (21:07 +0100)]
Automatically wipe Argon2i work area

crypto_wipe() wipes byte by byte.  This is fine for small buffers, but
for the Argon2i work area, it means losing about 20% performance.

This has a direct impact on security: users are advised to chose the
highest settings they are comfortable with.  A 20% slow down will mean
a 20% edge for the attacker.) Users must then chose between
sacrificing 20% of security, or exposing themselves to side channel
attacks.

---

There is a faster way to wipe that work area: word by word.  Since it
is already required to be aligned for 8-byte words, we can wipe it in
8-bytes chunks.  This is much faster than crypto_wipe, and slows down
the whole process by only 2-3%.

This is a bit ad-hoc, though, and it wouldn't make much sense to add a
crypto_wipe_fast() function or something to handle that special case.
Instead, I've chosen to integrate it in Argon2i itself.  Now users
don't have to wipe the work area any more.

The drawback is, the output hash buffer must not overlap with the work
area, or it will be wiped with it.  This shouldn't be a problem in
practice.

8 years agoManual review: applying CuleX's advice
Loup Vaillant [Wed, 1 Nov 2017 16:59:13 +0000 (17:59 +0100)]
Manual review: applying CuleX's advice

Replaced 'evil' by 'malicious'

8 years agoMerge pull request #57 from mikejsavage/deterministically
Loup Vaillant [Wed, 1 Nov 2017 16:52:41 +0000 (17:52 +0100)]
Merge pull request #57 from mikejsavage/deterministically

eterministically -> deterministically

8 years agoMerge branch 'master' into deterministically
Loup Vaillant [Wed, 1 Nov 2017 16:51:50 +0000 (17:51 +0100)]
Merge branch 'master' into deterministically

8 years agoMerge branch 'master' into deterministically
Loup Vaillant [Wed, 1 Nov 2017 16:50:08 +0000 (17:50 +0100)]
Merge branch 'master' into deterministically

8 years agoManual review: key exchange
Loup Vaillant [Wed, 1 Nov 2017 11:01:48 +0000 (12:01 +0100)]
Manual review: key exchange

8 years agoeterministically -> deterministically
Michael Savage [Tue, 31 Oct 2017 20:10:25 +0000 (22:10 +0200)]
eterministically -> deterministically

8 years agoManual review: argon2i
Loup Vaillant [Sun, 29 Oct 2017 17:43:51 +0000 (18:43 +0100)]
Manual review: argon2i

8 years agoManual review: verify, wipe, memcmp
Loup Vaillant [Sun, 29 Oct 2017 16:43:47 +0000 (17:43 +0100)]
Manual review: verify, wipe, memcmp

Rephrased a bit.
Removed references to the rest of Monocypher.  That advice
belongs to the Blake2b and Argon2i pages.

8 years agoManual review: HChacha20
Loup Vaillant [Sun, 29 Oct 2017 15:01:34 +0000 (16:01 +0100)]
Manual review: HChacha20

8 years agoForgot a contraction
Loup Vaillant [Sun, 29 Oct 2017 15:01:00 +0000 (16:01 +0100)]
Forgot a contraction

8 years agoManual review: applying CuleX's advice
Loup Vaillant [Sat, 28 Oct 2017 11:56:03 +0000 (13:56 +0200)]
Manual review: applying CuleX's advice

* Removed contractions for a more formal style.
* Spelled BLAKE2b upper case.
* Put a final period *after* the parenthesis.

8 years agoManual review: Blake2b
Loup Vaillant [Wed, 25 Oct 2017 20:31:57 +0000 (22:31 +0200)]
Manual review: Blake2b

Minor tweaks everywhere, expanded the examples section.

8 years agoManual review: side channel protection nitpicking
Loup Vaillant [Sun, 22 Oct 2017 18:00:16 +0000 (20:00 +0200)]
Manual review: side channel protection nitpicking

8 years agoWipe some more secret data
Loup Vaillant [Sat, 21 Oct 2017 23:24:50 +0000 (01:24 +0200)]
Wipe some more secret data

8 years agoManual review: applying CuleX's advice
Loup Vaillant [Sat, 21 Oct 2017 23:06:23 +0000 (01:06 +0200)]
Manual review: applying CuleX's advice

8 years agoManual review: Poly1305
Loup Vaillant [Sat, 21 Oct 2017 16:37:39 +0000 (18:37 +0200)]
Manual review: Poly1305

8 years agoMerge pull request #56 from CuleX/master+crypto-wipe-man-page
Loup Vaillant [Sat, 21 Oct 2017 15:45:45 +0000 (17:45 +0200)]
Merge pull request #56 from CuleX/master+crypto-wipe-man-page

Add man page for crypto_wipe

8 years agoAdd man page for crypto_wipe
CuleX [Fri, 20 Oct 2017 11:52:11 +0000 (13:52 +0200)]
Add man page for crypto_wipe

This includes adjustments in other manual pages and examples, telling
the user to use crypto_wipe.

8 years agoAdded crypto_wipe() (Erases buffers)
Loup Vaillant [Thu, 19 Oct 2017 21:27:00 +0000 (23:27 +0200)]
Added crypto_wipe() (Erases buffers)

I've been convinced that wiping secrets might be useful to mitigate
some side channel attacks where the attacker might read your memory
after you're done processing those secrets.

This probably wasn't the only copy, though.

8 years agoUppercase RFC
Loup Vaillant [Wed, 18 Oct 2017 19:19:43 +0000 (21:19 +0200)]
Uppercase RFC

8 years agoManual review: applying CuleX's advice
Loup Vaillant [Tue, 17 Oct 2017 18:52:36 +0000 (20:52 +0200)]
Manual review: applying CuleX's advice

8 years agoManual review: Chacha20
Loup Vaillant [Mon, 16 Oct 2017 21:46:39 +0000 (23:46 +0200)]
Manual review: Chacha20

I intended this to be a fairly light review, but this ended up being a
rather comprehensive rewrite...

I tried to follow the advice of mdoc(7) as much as possible.  CuleX
did a remarkable job adapting the old manual to man pages without
butchering the original text; but I now think it has to be butchered
eventually.

Expanded the EXAMPLES section.  I think it gives a clearer view of all
possible use cases that way.

Replaced STANDARDS by IMPLEMENTATION DETAILS.  The choice of primitive
has implications for the end users, and thus isn't a mere
implementation detail.  Also serves to emphasise that Monocypher does
implement widely reviewed standards, as opposed to home-invented
crypto.

Replaced CAVEATS by SECURITY CONSIDERATIONS.  Arguably, either section
would do.  I changed it because every consideration listed there would
trigger a vulnerability if not observed.

8 years agoManual review: intro
Loup Vaillant [Mon, 16 Oct 2017 21:45:02 +0000 (23:45 +0200)]
Manual review: intro

8 years agoMerge pull request #55 from CuleX/master+fix-uninstall
Loup Vaillant [Sat, 14 Oct 2017 17:32:21 +0000 (19:32 +0200)]
Merge pull request #55 from CuleX/master+fix-uninstall

make uninstall should not fail on partial installs

8 years agomake uninstall should not fail on partial installs
CuleX [Sat, 14 Oct 2017 16:27:54 +0000 (18:27 +0200)]
make uninstall should not fail on partial installs

rm returns non-zero when the target file does not exist.  This is
possible when e.g. a user only does install-doc but not install.

8 years agoErase old html files before generating the new ones
Loup Vaillant [Sat, 14 Oct 2017 15:40:13 +0000 (17:40 +0200)]
Erase old html files before generating the new ones

8 years agoMerge pull request #53 from CuleX/master+man-page-revamp
Loup Vaillant [Sat, 14 Oct 2017 15:23:08 +0000 (17:23 +0200)]
Merge pull request #53 from CuleX/master+man-page-revamp

Revamp man pages for recent changes

8 years agoMerge pull request #54 from CuleX/master+fix-code-typo
Loup Vaillant [Sat, 14 Oct 2017 15:05:43 +0000 (17:05 +0200)]
Merge pull request #54 from CuleX/master+fix-code-typo

Fix typo in comment

8 years agoFix typo in comment
CuleX [Sat, 14 Oct 2017 11:28:38 +0000 (13:28 +0200)]
Fix typo in comment

paralell -> parallel

8 years agoRevamp man pages for recent changes
CuleX [Sat, 14 Oct 2017 11:24:33 +0000 (13:24 +0200)]
Revamp man pages for recent changes

New functions documented:
* crypto_sign (incremental interface)
* crypto_verify16/32/64

Deprecated functions:
* crypto_memcmp
* crypto_zerocmp

Other changes:
* crypto_lock and crypto_aead_lock pages have been merged as they are
  closer to each other in complexity than the incremental and low-level
  crypto_lock interface.

The crypto_memcmp and crypto_zerocmp pages have not been removed in case
people still have references to those functions in their code and are
wondering what the canonical replacement is.

8 years agoSimplified zerocmp32
Loup Vaillant [Sat, 14 Oct 2017 10:29:09 +0000 (12:29 +0200)]
Simplified zerocmp32

8 years agoFixed bogus comparison functions
Loup Vaillant [Sat, 14 Oct 2017 10:11:20 +0000 (12:11 +0200)]
Fixed bogus comparison functions

Found by michaelforney on Github.

- On neq0     , I used ^ instead of |
- On zerocmp32, I used + instead of |

Both errors lead to false negatives: you *think* all went well and the
number looks like it is indeed, zero, but it's not.  This could lead
to vulnerabilities in practice, where we could use the flaws in the
comparison functions to find pseudo-collisions, that defeat the checks
without being actual collisions.

Oops.

8 years agoRemoved crypto_memcmp and crypto_zerocmp
Loup Vaillant [Fri, 13 Oct 2017 20:37:34 +0000 (22:37 +0200)]
Removed crypto_memcmp and crypto_zerocmp

Fixes #38

This breaks compatibility.  Users need to switch to the crypto_verify
functions.  Sorry.

I do not break compatibility lightly.

Under the heaviest optimisation options (-O3), the old comparison
functions generated a huge amount of code, with quite a few
conditional branches.  It wasn't clear those branches weren't input
dependent.  This could lead to timing attacks down the line.

This is not just theoretical.  During my tests, I have observed
suspect timings (that's why I looked at the assembly in the first
place).  I tried to tweak the implementations, to no avail (some of my
tweaks actually made things worse).

Using more reasonable optimisation settings (-O2) is not an option:
the performance of `-O3` is simply too juicy to be ignored.  Some
users *will* sacrifice security to use it, even if I tell them not to.

The crypto_verify functions emit very terse and clean assembly, which
contains no conditional branches, and no input dependent indices.
That I can trust.

8 years agoadded fixed size buffer comparisons
Loup Vaillant [Fri, 13 Oct 2017 20:20:17 +0000 (22:20 +0200)]
added fixed size buffer comparisons

8 years agoless code for loads & stores
Loup Vaillant [Fri, 13 Oct 2017 20:00:47 +0000 (22:00 +0200)]
less code for loads & stores

8 years agoUse helper function
Loup Vaillant [Wed, 11 Oct 2017 21:20:05 +0000 (23:20 +0200)]
Use helper function

8 years agoMore robust Argon2i test vectors generation
Loup Vaillant [Fri, 13 Oct 2017 09:26:27 +0000 (11:26 +0200)]
More robust Argon2i test vectors generation

The default algorithm in libsodium has changed, presumably from
Argon2i to Argon2id.  We now specify Argon2i explicitly.

8 years agoRefined AEAD streaming interface
Loup Vaillant [Wed, 11 Oct 2017 20:58:10 +0000 (22:58 +0200)]
Refined AEAD streaming interface

8 years agoRenamed init1 and init2 into init_first_pass and init_second_pass
Loup Vaillant [Wed, 11 Oct 2017 18:57:15 +0000 (20:57 +0200)]
Renamed init1 and init2 into init_first_pass and init_second_pass

The names are a bit long for my taste, but we must be absolutely clear
to the user that we need two passes.  Hopefully "first" will act as a
strong enough hint that there is a "second".

8 years agoAdded crypto_sign 2 pass interface
Loup Vaillant [Mon, 9 Oct 2017 21:42:30 +0000 (23:42 +0200)]
Added crypto_sign 2 pass interface

Also refined the crypto_check incremental interface (again).  Having
to pass arguments in the final() function we already passed to init()
is cumbersome and error prone.  I removed this nonsense.

8 years agoCosmetic (compressed a few lines of code)
Loup Vaillant [Mon, 9 Oct 2017 19:05:25 +0000 (21:05 +0200)]
Cosmetic (compressed a few lines of code)

8 years agoRefined crypto_check incremental interface
Loup Vaillant [Mon, 9 Oct 2017 19:00:06 +0000 (21:00 +0200)]
Refined crypto_check incremental interface

8 years agoStreaming interface for crypto_check()
Loup Vaillant [Sun, 8 Oct 2017 22:14:36 +0000 (00:14 +0200)]
Streaming interface for crypto_check()

8 years agoAdded rountrip tests for EdDSA
Loup Vaillant [Sun, 8 Oct 2017 22:13:56 +0000 (00:13 +0200)]
Added rountrip tests for EdDSA

8 years agomoved SHA-512 source files to src/optional
Loup Vaillant [Sun, 8 Oct 2017 20:19:45 +0000 (22:19 +0200)]
moved SHA-512 source files to src/optional

There are 2 reasons behind this change:

- The primary way to install Monocypher is to copy the source files
  into one's own project.  But it wasn't clear whether `sha512.c` and
  `sha512.h` are meant to be copied as well.

- Monocypher is advertised as a single source file library (or a 2
  files library if you count the header), and a casual glance may
  disagree.

Now things should be much clearer.

---

I made another slight change to the vector generation process: I
removed the optimisation options, which in conjunction with `-std=c99`
seem to trigger a bug in GCC 5.4.0 (it can't find a type definition).
Clang works.

Those optimisation options slowed down the whole process anyway, so no
loss there.

8 years agoMissing constant width quotes
Loup Vaillant [Sun, 8 Oct 2017 18:45:27 +0000 (20:45 +0200)]
Missing constant width quotes

8 years agoMerge pull request #52 from CuleX/master+fix-man-typos
Loup Vaillant [Fri, 6 Oct 2017 12:15:49 +0000 (14:15 +0200)]
Merge pull request #52 from CuleX/master+fix-man-typos

Fix formatting and typos in the man pages; note Ed25519 fault injection on crypto_sign

8 years agoNote Ed25519 fault injection on crypto_sign
CuleX [Fri, 6 Oct 2017 11:41:14 +0000 (13:41 +0200)]
Note Ed25519 fault injection on crypto_sign

See
https://research.kudelskisecurity.com/2017/10/04/defeating-eddsa-with-faults/
and
https://news.ycombinator.com/item?id=15415114

8 years agoFix formatting and typos in the man pages
CuleX [Fri, 6 Oct 2017 11:31:56 +0000 (13:31 +0200)]
Fix formatting and typos in the man pages

8 years agoOne quote too many
Loup Vaillant [Wed, 4 Oct 2017 21:39:26 +0000 (23:39 +0200)]
One quote too many

8 years agoMerge pull request #50 from CuleX/master+add-incr-lock-to-intro-man-page
Loup Vaillant [Wed, 4 Oct 2017 21:34:21 +0000 (23:34 +0200)]
Merge pull request #50 from CuleX/master+add-incr-lock-to-intro-man-page

Add incremental crypto_lock interface to intro TOC

8 years agoAdded a make tarball rule to generate an archive
Loup Vaillant [Wed, 4 Oct 2017 21:28:53 +0000 (23:28 +0200)]
Added a make tarball rule to generate an archive

Also updated the README.md a little: added "manual" and "contributor
notes" sections, expanded the installation section, and a couple minor
other edits.

8 years agoMerge pull request #51 from CuleX/master+fix-mandoc-invocation
Loup Vaillant [Wed, 4 Oct 2017 19:00:59 +0000 (21:00 +0200)]
Merge pull request #51 from CuleX/master+fix-mandoc-invocation

Fix mandoc invocation for recent mandoc versions

8 years agoFix mandoc invocation for recent mandoc versions
CuleX [Wed, 4 Oct 2017 18:53:48 +0000 (20:53 +0200)]
Fix mandoc invocation for recent mandoc versions

A commit in mandoc earlier this year subtly broke the -O parsing.
Multiple instances of -O do not get parsed, so all options have to be
passed into the same -O with comma separation as intended.

8 years agoAdd incremental crypto_lock interface to intro TOC
CuleX [Wed, 4 Oct 2017 18:22:59 +0000 (20:22 +0200)]
Add incremental crypto_lock interface to intro TOC

8 years agoMerge pull request #49 from CuleX/master+fix-man-xr-links
Loup Vaillant [Wed, 4 Oct 2017 08:17:42 +0000 (10:17 +0200)]
Merge pull request #49 from CuleX/master+fix-man-xr-links

Fix link generation in HTML man page conversion

8 years agoFix link generation in HTML man page conversion
CuleX [Wed, 4 Oct 2017 03:30:30 +0000 (05:30 +0200)]
Fix link generation in HTML man page conversion

We strip the ".3monocypher" from the filename, so the -Oman argument
needs to reflect that.

8 years agoGenerating an html version of the manual
Loup Vaillant [Tue, 3 Oct 2017 22:05:18 +0000 (00:05 +0200)]
Generating an html version of the manual

Now the users will be able to enjoy a readable manual even without the
man pages.

One hassle though: I expected links between the pages, and I se none.
Limitation of the converter, or bug in my script?

8 years agoCredit where credit's due
Loup Vaillant [Tue, 3 Oct 2017 20:22:46 +0000 (22:22 +0200)]
Credit where credit's due

CuleX contributed more than all others combined, it was past time we
update the author's page.

8 years agoMerge pull request #48 from CuleX/master+fix-man-pages
Loup Vaillant [Mon, 2 Oct 2017 06:24:58 +0000 (08:24 +0200)]
Merge pull request #48 from CuleX/master+fix-man-pages

Man page improvements; properly document incremental crypto_lock/unlock

8 years agoImprove the man page for incremental crypto_lock
CuleX [Mon, 2 Oct 2017 04:14:06 +0000 (06:14 +0200)]
Improve the man page for incremental crypto_lock

This fixes the function types in the SYNOPSIS section and removes a
stray macro.

This adds information about the incremental interface to the DESCRIPTION
section.  In particular, it documents the tradeoff (convenience of the
interface vs. performance loss on forged messages).

INCREMENTAL INTERFACE, which seemed to just be a subset to the EXAMPLES
section, got lowered into a second-level heading.

8 years agoFix spacing after list in crypto_blake2b man page
CuleX [Mon, 2 Oct 2017 04:09:30 +0000 (06:09 +0200)]
Fix spacing after list in crypto_blake2b man page

8 years agoAdded incremental interface
Loup Vaillant [Sun, 1 Oct 2017 18:40:52 +0000 (20:40 +0200)]
Added incremental interface

Fixed #29

Bonus: we now can authenticate a message without decrypting it.

8 years agoFixed code coverage checking
Loup Vaillant [Sun, 1 Oct 2017 14:05:41 +0000 (16:05 +0200)]
Fixed code coverage checking

Fixed #47

The manual was missing the `-fcoverage-mapping` option, of course we
didn't have coverage data...

Also changed `llvm-cov` to `llvm-cov-3.8` on tests/coverage.sh: some
systems don't have the versionless alias.

8 years agoAdd uninstall target.
Loup Vaillant [Wed, 27 Sep 2017 18:15:47 +0000 (20:15 +0200)]
Add uninstall target.

Fixes #46

8 years agoDon't add the .css file when installing the documentation
Loup Vaillant [Wed, 27 Sep 2017 18:07:49 +0000 (20:07 +0200)]
Don't add the .css file when installing the documentation

Fixes #45

Another option would be to move the .css file elsewhere, but this fix
is more resilient.

8 years agoMerge pull request #44 from CuleX/master+fix-css
Loup Vaillant [Wed, 27 Sep 2017 06:14:32 +0000 (08:14 +0200)]
Merge pull request #44 from CuleX/master+fix-css

Add old CSS class names; add centering

8 years agoAdd old CSS class names; add centering
CuleX [Tue, 26 Sep 2017 13:29:25 +0000 (15:29 +0200)]
Add old CSS class names; add centering

It turns out that they are still used when doing e.g. .Bf Em (yiedling a
block <div class="emph">...</div>).

I also forgot to add centering, which I've had on my GitHub Pages of
the HTML exported man pages.

8 years agoAdded a `check` target to the makefile, that means the same as `test`
Loup Vaillant [Mon, 25 Sep 2017 20:11:15 +0000 (22:11 +0200)]
Added a `check` target to the makefile, that means the same as `test`

Automake specifies that `make check` runs the test suite.  We should
respect such conventions.  `make test` still works ("test" is a good
name for such a target).

8 years agoMerge pull request #41 from CuleX/master+argon2i-man-page-fix
Loup Vaillant [Sun, 24 Sep 2017 18:27:28 +0000 (20:27 +0200)]
Merge pull request #41 from CuleX/master+argon2i-man-page-fix

Document argon2i allowing all arguments to overlap

8 years agoNo need for testing Ed25519 specificaly
Loup Vaillant [Sun, 24 Sep 2017 15:34:14 +0000 (17:34 +0200)]
No need for testing Ed25519 specificaly

EdDSA works.  SHA-512 is properly tested.  Replacing Blake2b by
SHA-512 is only a pre-processor directive away —it's foolproof.  We
don't need specific Ed-25519 tests.

8 years agoThe speed tests now run. Removed the README note.
Loup Vaillant [Sun, 24 Sep 2017 15:26:43 +0000 (17:26 +0200)]
The speed tests now run.  Removed the README note.

8 years agoRestored sanitisers based tests.
Loup Vaillant [Sun, 24 Sep 2017 15:16:44 +0000 (17:16 +0200)]
Restored sanitisers based tests.

We no longer ask the user to modify the makefile.  We instead override
the relevant variables from the command line.

8 years agoCorrected bogus EdDSA coverage test (stack smashing undefined behaviour)
Loup Vaillant [Sun, 24 Sep 2017 13:19:03 +0000 (15:19 +0200)]
Corrected bogus EdDSA coverage test (stack smashing undefined behaviour)

8 years agoRestored formal analysis scripts
Loup Vaillant [Sun, 24 Sep 2017 10:56:48 +0000 (12:56 +0200)]
Restored formal analysis scripts

8 years agoDocument argon2i allowing all arguments to overlap
CuleX [Sun, 24 Sep 2017 10:25:57 +0000 (12:25 +0200)]
Document argon2i allowing all arguments to overlap

8 years agoAdded overlapping tests for argon2i
Loup Vaillant [Sun, 24 Sep 2017 10:03:45 +0000 (12:03 +0200)]
Added overlapping tests for argon2i

Related to #32

8 years agoRearranged directory creation for makefile installation target
Loup Vaillant [Sun, 24 Sep 2017 09:21:16 +0000 (11:21 +0200)]
Rearranged directory creation for makefile installation target

Tweaking #40 pull request.  Have the `mkdir` on several lines because
of my 80 columns OCD.  It also makes prettier printouts at runtime.

Also removed the spurrious creation of the man directory (it was
already done on the `install-doc:` target).

8 years agoMerge pull request #40 from CuleX/master+fix-install
Loup Vaillant [Sun, 24 Sep 2017 09:14:44 +0000 (11:14 +0200)]
Merge pull request #40 from CuleX/master+fix-install

Create all installation directories

8 years agoCreate all installation directories
CuleX [Sat, 23 Sep 2017 17:55:58 +0000 (19:55 +0200)]
Create all installation directories

This is required for the DESTDIR variable to actually work and create
the necessary tree.

8 years agoAdded installation instructions to README.md
Loup Vaillant [Sat, 23 Sep 2017 17:14:50 +0000 (19:14 +0200)]
Added installation instructions to README.md

8 years agoAdded a separate install-doc target
Loup Vaillant [Sat, 23 Sep 2017 17:07:17 +0000 (19:07 +0200)]
Added a separate install-doc target

Since Monocypher can be used without any installation (just copy the
source files to your project), some users may want the man pages
without an actual installation.

`make install` still installs everything, documentation included.

8 years agoMake pkg-config file location $PREFIX compliant
Loup Vaillant [Sat, 23 Sep 2017 17:01:28 +0000 (19:01 +0200)]
Make pkg-config file location $PREFIX compliant

It was previously semi-hard coded, presumably because I was tired.

8 years agoMerge pull request #39 from CuleX/master+update-man-pages
Loup Vaillant [Sat, 23 Sep 2017 12:37:28 +0000 (14:37 +0200)]
Merge pull request #39 from CuleX/master+update-man-pages

Add overlapping argument info to the man pages

8 years agoAdd overlapping argument info to the man pages
CuleX [Sat, 23 Sep 2017 10:37:50 +0000 (12:37 +0200)]
Add overlapping argument info to the man pages

8 years agoRemoved "crypto_sign() buffers can't overlap" from the man page.
Loup Vaillant [Sat, 23 Sep 2017 10:30:49 +0000 (12:30 +0200)]
Removed "crypto_sign() buffers can't overlap" from the man page.

8 years agoNo need to run mandb after installing the man pages
Loup Vaillant [Sat, 23 Sep 2017 10:10:54 +0000 (12:10 +0200)]
No need to run mandb after installing the man pages

Turns out users don't need to run that program to read freshly
installed man pages.  Plus, that program doesn't seem to exist outside
of GNU systems.

The mandb program just refreshes a cache. Users can read the freshly
installed man pages without running it.

8 years agoMan pages belong to $(DESTDIR)/$(PREFIX)/share/man/man3 folder
Loup Vaillant [Sat, 23 Sep 2017 10:07:24 +0000 (12:07 +0200)]
Man pages belong to $(DESTDIR)/$(PREFIX)/share/man/man3 folder

They were originally sent to the man3monocypher folder instead, but we
don't need that: their .3monocypher extension already takes care of
the disambiguation.  It also has the advantage of allowing the user to
search for the man page in section 3 directly.

8 years agoAdd tests about overlapping input/output buffers.
Loup Vaillant [Fri, 22 Sep 2017 23:03:24 +0000 (01:03 +0200)]
Add tests about overlapping input/output buffers.

Chacha20 plaintext and cypher text memory buffers may be the same
(they cannot be different *and* overlaping).

Poly1305 input and tag buffer may overlap.
Blake2b input and hash buffers may overlap.
SHA-512 input and hash buffers may overlap.
Argon2i input and hash buffers may overlap.
EdDSA message and signature buffers may overlap.

8 years agoAllows crypto_sign() to overlap its message and output
Loup Vaillant [Fri, 22 Sep 2017 22:59:13 +0000 (00:59 +0200)]
Allows crypto_sign() to overlap its message and output

Fixes #32

The signature output buffer was set before the last message read.  If
they overlaped, we would have a bogus signature.

8 years agoInstall man pages with the library
Loup Vaillant [Fri, 22 Sep 2017 20:31:51 +0000 (22:31 +0200)]
Install man pages with the library

Fixes $24 (hopefully, nothing is missing this time).

8 years agoAdd installation target to the makefile
Loup Vaillant [Fri, 22 Sep 2017 07:34:54 +0000 (09:34 +0200)]
Add installation target to the makefile

Fixes #24

Defines and uses the $DESTDIR and $PREFIX variables. They can be
overriden from the command line. By default, they are set to "" and
"usr/local" respectively.

Defines and uses a $PKGCONFIG variable to set the location of the
pkgconfig configuration file (monocypher.pc).  That variable depends
on $PREFIX.

Copies libmonocypher.a, libmonocypher.so and monocypher.h to their
respective destinations, and creates the pkgconfig configuration file.

8 years agoFix last variable length array warning
Loup Vaillant [Thu, 21 Sep 2017 07:24:59 +0000 (09:24 +0200)]
Fix last variable length array warning

All gone now. Fixed #37

8 years agoCorrected timing computation for the speed benchmark
Loup Vaillant [Wed, 20 Sep 2017 22:32:59 +0000 (00:32 +0200)]
Corrected timing computation for the speed benchmark

I intended to take the best timing out of several tries.  Turned out I
only took the *last* timing, which defeats the purpose.

Now we take the fastest try as intended.  The results are now a bit
more stable.