François Garillot
6b22064863
Fold a few panics
...
Removes a few panics we don't need by folding them in the Error case of their enclosing Result return.
2020-12-09 13:10:05 -08:00
François Garillot
94630dff7c
Update dependencies
2020-12-09 12:44:24 -08:00
François Garillot
f8c976d659
add copyright stanza to expect script
2020-11-17 14:58:59 -05:00
François Garillot
05514e49aa
Correct platform size bug
2020-11-12 10:42:45 -05:00
François Garillot
eb1a93c379
Add cross-compilation on 32-bits
2020-11-09 10:22:54 -05:00
François Garillot
552a546b6c
Uses conditional compilation to make sure postprocessing is only available in tests
...
See
https://github.com/rust-lang/rust/pull/64010/
2020-11-04 11:55:14 -05:00
François Garillot
230b1bcef6
Start integrating the derivable SizedBytes
...
- just derive it on Key and KeyPair for now
2020-11-03 16:45:37 -05:00
François Garillot
aabd5266c3
Bump Crate version => 0.3.0-pre.1
2020-11-03 13:29:51 -08:00
François Garillot
6deddbe33c
adjust to_bytes -> serialize & example
2020-11-02 20:36:26 -05:00
François Garillot
7cc1c0992a
remove the last few constants
2020-11-02 20:15:05 -05:00
François Garillot
9c06c98ad6
Introduce enum structs to replicate TLS message format
...
This PR favors native coercions of enums to numerical types to help ser/de operations.
Small rearrangement of the serialization module.
2020-11-02 20:15:02 -05:00
François Garillot
344e8ad8d1
Updating serialization for RegisterFirstMessage ( #35 )
2020-11-02 20:14:47 -05:00
François Garillot
18bcd23102
Add publishing job
...
This published commits to master with a tag. Relies on a GHA token named crates_io.
2020-10-22 11:00:02 -04:00
François Garillot
25ae7ff9bf
Make Hash module public
...
Fixes #63
2020-10-21 18:24:55 -04:00
François Garillot
587ef935a7
Fix use of TryFrom<Vec<u8>> in key_exchange
...
We can directly require the HRTB on `for<'r> TryFrom<&'r [u8]>`.
Eliminates needless to_vec.
2020-09-24 14:31:29 +00:00
François Garillot
6b9583e928
Don't duplicate CI runs on PR & push
2020-09-23 17:57:15 -04:00
François Garillot
40ea015d6d
Remove the last superfluous constant
...
This required purgin the usage of the low-level Key access, but now we
should be able to replace the Key type piecemeal.
2020-09-22 08:50:39 -04:00
François Garillot
c97ddaf5d2
Make KeyExchange generic in KeyFormat
2020-09-21 14:46:04 -04:00
François Garillot
56d38dba2c
Reverse use of Tryinto<[u8; 64]> since it's not yet on stable
2020-09-20 10:13:43 -04:00
François Garillot
786bc51fdd
Normalize generic parameters for LoginSecondMessage
...
(aka use the CipherSuite just like the others)
Repair the generics in KE trait: it makes sense that generate_ke[1-3] should operate on the same key representation.
2020-09-19 19:16:36 -04:00
François Garillot
887b4577fa
fix misuse of constants in KE2Message
2020-09-19 19:16:34 -04:00
François Garillot
3c2a208606
surface the potential breakages out of copy_from_slice
2020-09-19 19:16:31 -04:00
François Garillot
3c555e82ae
Make tripleDH manipulate GenericArray<u8, N> over Vec<u8>
...
upgrade some of the structure contents of the KE types
2020-09-19 19:16:28 -04:00
François Garillot
b673f840a5
Compile the benchmarks in CI
2020-09-03 15:58:40 -04:00
François Garillot
81353cb844
fix benchmarks
2020-09-03 15:54:46 -04:00
François Garillot
ab8db3bf03
Propagate usage of Elligator2 map
...
Fixes #30 , #37
2020-09-03 14:17:45 -04:00
François Garillot
dede91a5b7
Add additional test vectors from Signal
2020-09-03 14:17:44 -04:00
François Garillot
f1bdfcd3a0
Add elligator mapping for hash-to-curve
2020-09-03 14:17:43 -04:00
François Garillot
2c9e47d14d
Proptests exercising try_from for most structures based on random data
...
This also fixes crashes in:
- RegisterFirstMessage,
- LoginFirstMessage,
- ClientRegistration,
- ClientLogin
2020-09-02 10:29:22 -04:00
François Garillot
6dde7c5351
Update all dependencies to the lates version
...
Not. now using the same upcoming dalek versions (curve25519-dalek v 3)
2020-08-26 09:44:23 -04:00
François Garillot
694c51c982
remove unneeded Repr = Key
2020-08-24 15:16:51 -04:00
François Garillot
07a702c1be
make clippy happier
2020-08-24 15:13:20 -04:00
François Garillot
29ba1b93b5
Check for small subgroup components when using the EdwardsPoint group for the OPRF
...
A malicious attacker sending a small point could lead the server / user to leak private information.
The check avoiding mixed order points (rather than just small) is prohibitively expensive, and I don't know how an attacker would extract any data from that => we focus on a small order check.
Fixes #34 .
2020-08-24 14:50:29 -04:00
François Garillot
6b1e485763
Update minor versions as appropriate
2020-07-23 14:49:49 -04:00
François Garillot
7b11da3bd6
Remove 2x superfluous to_vec
2020-07-23 13:45:46 -04:00
François Garillot
8885fe5aa1
Re-establish cargo check --all-targets
...
The bench in benches/oprf.rs requires a feature to have visibility over private members, and doesn't work without it.
`cargo check --all-targets` is the standard quick way to check code under build & test targets, but does not specify features.
This simply skips the `benches` when the `"bench"` feature it depends on is not activated.
2020-07-22 15:22:47 -04:00
François Garillot
b0b9cd0ab2
Restructure GH tests, run on u64 & u32
2020-07-22 15:04:06 -04:00
François Garillot
4fda240a7d
Pass the {curve, x}25519-dalek features through the build
2020-07-22 14:59:06 -04:00
François Garillot
91137903c6
Add benchmarks for OPRF functions (under a bench feature)
2020-07-22 14:32:58 -04:00
François Garillot
e93e8fd5a8
Make the group mod public
2020-07-22 11:58:00 -04:00
François Garillot
69449cca3e
Activate #![deny(missing_docs)], #![deny(unsafe_code)]
2020-07-06 15:40:35 -04:00
François Garillot and KevinLewi
9d40aa7659
As a way to roll back the genericity, implement an extension trait of group for password-to-curve hashing,
...
This supersedes #18 .
Co-authored-by: KevinLewi <[email protected] >
2020-07-03 21:05:18 -04:00
François Garillot
41cd80ccb5
Make oprf::generate_oprf1 generic in the Digest, as long as it matches the hash-to-curve intake of the group
...
We used to have three problems:
- overuse of the <Sha256 as Digest>::OutputSize, which is just, well, U32. Sometimes used as a parameter (as in generate_oprf1), sometimes as a constant (as in generate_oprf3).
- the `hash_to_curve` operation for `RistrettoPoint` which requires 64 bits of input entropy, is fed 64 bits of which the last 32 are zero,
- the `hash_to_curve` operation for `Curve25519Point` which requires 32 bits of input entropy, is fed 64 bits of which the last 32 are discarded,
This corrects all three and uses U32 where the size of the digest is not meant to be a constraint.
Addresses #15 partially.
2020-07-03 18:28:34 -04:00
François Garillot
52429dd2fa
fix a clone-on-copy-type
2020-07-03 17:30:33 -04:00
François Garillot
bb9c365998
Rename Group::to_bytes() into Group::to_arr(),
...
This brings the `Group` and `SizedBytes` traits into some sort of name
coherence (they both return a GenericArray). This also uses
`&my_generic_array[..]` (i.e. the `Deref` impl) over
`my_generic_array.as_slice()`.
2020-07-03 17:30:32 -04:00
François Garillot
3e41f2441d
mention issue for direct call into uniform_bytes in RistrattoPoint
2020-07-03 16:12:14 -04:00
François Garillot
59d997900e
Simplify "<CS as CipherSuite>" where possible
2020-07-03 15:58:42 -04:00
François Garillot and Kevin Lewi
4a638b8a22
add deny check to CI
2020-06-29 15:52:30 -07:00
François Garillot
642d5188f5
Run CI with all-features
2020-06-19 15:24:04 -04:00
François Garillot
c9d467e368
Add (normal) macros showing how to generate SizedBytes to/from TryFrom + to_bytes
...
This is useful for getting serialization of the KEXState, KEXMessage formats without too much boilerplate
Add client_login, login_first_message roundtrip serialization tests
2020-06-19 15:23:21 -04:00
François Garillot
738b90188d
add build badge
2020-06-19 15:23:04 -04:00
François Garillot
7a2d309263
Moves the keypair generation to an extension trait
...
This technical change lets us avoid polluting the code with derives of Debug.
2020-06-19 15:23:03 -04:00
François Garillot
4f9b7fe86f
Update digest & hashes libraries to their latest versions
2020-06-16 06:24:14 -07:00
François Garillot
3ae1c58d46
test DH as well
2020-06-13 09:07:57 -04:00
François Garillot
e9fa474c58
Remove SignalKeyPair, rename all instances of SignalKeyPair to X25519KeyPair, pass all tests.
2020-06-13 09:07:55 -04:00
François Garillot
e9add9fd7a
add tests showing X25519KeyPair == SignalKeyPair
2020-06-13 09:07:53 -04:00
François Garillot
b401cfc89c
Added proptest strategy to generate a random keypair
2020-06-13 09:07:51 -04:00
François Garillot
cd46a42634
Have CI run more often
2020-06-12 18:49:32 -04:00
François Garillot
ce1d97002c
cleaner to_bytes() for a few structures
2020-06-12 18:38:14 -04:00