]> git.codecow.com Git - Monocypher.git/log
Monocypher.git
6 years agoFixed broken compilation
Loup Vaillant [Mon, 9 Mar 2020 15:09:53 +0000 (16:09 +0100)]
Fixed broken compilation

6 years agoElligator script: removed unnecessary temporary
Loup Vaillant [Mon, 9 Mar 2020 12:16:15 +0000 (13:16 +0100)]
Elligator script: removed unnecessary temporary

6 years agoAdded Elligator2 direct map
Loup Vaillant [Mon, 9 Mar 2020 11:33:39 +0000 (12:33 +0100)]
Added Elligator2 direct map

6 years agoMerge pull request #158 from fscoto/master+randombytes
Loup Vaillant [Mon, 2 Mar 2020 10:24:02 +0000 (11:24 +0100)]
Merge pull request #158 from fscoto/master+randombytes

Add random_bytes() to crypto_lock examples

6 years agocrypto_sign example: sign the *entire* message
Fabio Scotoni [Mon, 2 Mar 2020 08:53:09 +0000 (09:53 +0100)]
crypto_sign example: sign the *entire* message

6 years agoextract_examples.sh: warning cleanup
Fabio Scotoni [Mon, 2 Mar 2020 07:36:52 +0000 (08:36 +0100)]
extract_examples.sh: warning cleanup

1. Remove now-unused random_bytes().
2. "warning: empty struct has size 0 in C, size 1 in C++ [-Wc++-compat]"
   "warning: empty struct is a GNU extension [-Wgnu-empty-struct]"
   clang -Weverything

6 years agoMerge branch 'master' into master+randombytes
Fabio Scotoni [Mon, 2 Mar 2020 07:35:42 +0000 (08:35 +0100)]
Merge branch 'master' into master+randombytes

6 years agocrypto_sha512 example overhaul
Fabio Scotoni [Mon, 2 Mar 2020 07:33:38 +0000 (08:33 +0100)]
crypto_sha512 example overhaul

Just gives it a message to hash, matching crypto_blake2b(3monocypher).
Nothing to randomize.

6 years agocrypto_hmac_sha512 example overhaul
Fabio Scotoni [Mon, 2 Mar 2020 07:28:18 +0000 (08:28 +0100)]
crypto_hmac_sha512 example overhaul

1. Randomize the key.
2. Key for HMAC is NOT optional.
3. Give it an actual example message to authenticate.

6 years agocrypto_x25519 example overhaul
Fabio Scotoni [Mon, 2 Mar 2020 07:21:31 +0000 (08:21 +0100)]
crypto_x25519 example overhaul

Just adds arc4random_buf().

6 years agocrypto_sign example overhaul
Fabio Scotoni [Mon, 2 Mar 2020 07:15:29 +0000 (08:15 +0100)]
crypto_sign example overhaul

1. Randomize key.
2. Give it an actual example message to sign.

6 years agocrypto_poly1305 example overhaul
Fabio Scotoni [Mon, 2 Mar 2020 07:08:37 +0000 (08:08 +0100)]
crypto_poly1305 example overhaul

1. Randomize key.
2. Give it an actual example message to MAC.

6 years agocrypto_key_exchange example overhaul
Fabio Scotoni [Mon, 2 Mar 2020 07:03:20 +0000 (08:03 +0100)]
crypto_key_exchange example overhaul

Just adds arc4random_buf().

6 years agocrypto_hchacha20 example overhaul
Fabio Scotoni [Mon, 2 Mar 2020 07:00:58 +0000 (08:00 +0100)]
crypto_hchacha20 example overhaul

Just adds arc4random_buf() for the key.

6 years agocrypto_chacha20 example overhaul
Fabio Scotoni [Mon, 2 Mar 2020 06:57:22 +0000 (07:57 +0100)]
crypto_chacha20 example overhaul

1. Randomize keys and nonces.
2. Minor alignment fix in second example.
3. Make i unsigned to avoid clang warning about 500-(i-64) changing
   signedness with -Weverything.
4. Initialize ctr to 0.
5. Fix obviously wrong encryption by jumping around example
   (repeating ctr issue [!], wrong function used in the example).

6 years agocrypto_blake2b example overhaul
Fabio Scotoni [Mon, 2 Mar 2020 06:41:02 +0000 (07:41 +0100)]
crypto_blake2b example overhaul

1. A key when "Computing a message authentication code" is NOT optional.
2. Randomize keys.

6 years agocrypto_argon2i example overhaul
Fabio Scotoni [Mon, 2 Mar 2020 06:34:14 +0000 (07:34 +0100)]
crypto_argon2i example overhaul

1. The common type for a password is char*; use a cast instead.
   C11, para. 6.5(7) suggests this will be largely okay.
2. Wipe the password on failure.
3. Initialize the password size while there.
   Does not use strlen(3) to avoid extra stdlib functions.
4. Branch on allocation failure.

6 years agoElligator script: clean up & comments
Loup Vaillant [Sun, 1 Mar 2020 21:50:39 +0000 (22:50 +0100)]
Elligator script: clean up & comments

6 years agoAnother attempt at crypto_lock example overhaul
Fabio Scotoni [Sun, 1 Mar 2020 11:40:43 +0000 (12:40 +0100)]
Another attempt at crypto_lock example overhaul

6 years agoMerge pull request #160 from fscoto/master+test-typo
Loup Vaillant [Sun, 1 Mar 2020 10:46:34 +0000 (11:46 +0100)]
Merge pull request #160 from fscoto/master+test-typo

tests: fix typo in messages

6 years agotests: fix typo in messages
Fabio Scotoni [Sun, 1 Mar 2020 10:09:47 +0000 (11:09 +0100)]
tests: fix typo in messages

6 years agoMerge pull request #159 from richwalm/master
Loup Vaillant [Sat, 29 Feb 2020 23:32:49 +0000 (00:32 +0100)]
Merge pull request #159 from richwalm/master

Document & test overlapping of key_exchange.

6 years agoPerform a full overlapping range for test.
Richard Walmsley [Sat, 29 Feb 2020 21:53:35 +0000 (10:53 +1300)]
Perform a full overlapping range for test.

Also done the same for x25519 and included copyright details.

6 years agoDocument & test overlapping of key_exchange.
Richard Walmsley [Sat, 29 Feb 2020 10:48:51 +0000 (23:48 +1300)]
Document & test overlapping of key_exchange.

6 years agoElligator script: added paper URL
Loup Vaillant [Sat, 29 Feb 2020 10:33:45 +0000 (11:33 +0100)]
Elligator script: added paper URL

6 years agoAdd random_bytes() to crypto_lock examples
Fabio Scotoni [Sat, 29 Feb 2020 06:50:31 +0000 (07:50 +0100)]
Add random_bytes() to crypto_lock examples

6 years agoElligator script: comments & proofs
Loup Vaillant [Fri, 28 Feb 2020 23:18:58 +0000 (00:18 +0100)]
Elligator script: comments & proofs

6 years agoElligator script: general organisation
Loup Vaillant [Thu, 27 Feb 2020 23:40:23 +0000 (00:40 +0100)]
Elligator script: general organisation

6 years agoElligator script: removed slow scalarmult
Loup Vaillant [Thu, 27 Feb 2020 21:49:20 +0000 (22:49 +0100)]
Elligator script: removed slow scalarmult

6 years agoElligator script: clarified non-square
Loup Vaillant [Thu, 27 Feb 2020 21:43:58 +0000 (22:43 +0100)]
Elligator script: clarified non-square

6 years agoElligator Script: ackwowledge Andrew Moon's contribution
Loup Vaillant [Thu, 27 Feb 2020 19:58:22 +0000 (20:58 +0100)]
Elligator Script: ackwowledge Andrew Moon's contribution

6 years agoReplaced fast mappings by even better ones
Loup Vaillant [Wed, 26 Feb 2020 21:14:57 +0000 (22:14 +0100)]
Replaced fast mappings by even better ones

Turned out there were much simpler ways to compute the mapping, thanks
to the fact that when the prime p is congruent to 5 modulo 8, we have
this nice equality:

    x^((p-5)/8) = sqrt(1/x)          if x is square,
    x^((p-5)/8) = sqrt(sqrt(-1)/x)   otherwise

The code was kindly given by Andrew Moon, who got the original trick
from Mike Hamburg.

6 years agoMerge pull request #157 from fscoto/master+examples
Loup Vaillant [Wed, 26 Feb 2020 17:34:02 +0000 (18:34 +0100)]
Merge pull request #157 from fscoto/master+examples

Examples: const correctness

6 years agoExamples: const correctness
Fabio Scotoni [Tue, 25 Feb 2020 08:53:24 +0000 (09:53 +0100)]
Examples: const correctness

It's unfortunate that we can't both tell users to wipe keys and
illustrate which arguments are inputs and which ones are outputs
at the same time, but that's just how it is.

6 years agoElligator scritp: positive/negative cosmetic
Loup Vaillant [Tue, 25 Feb 2020 00:13:03 +0000 (01:13 +0100)]
Elligator scritp: positive/negative cosmetic

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