Jack Lloyd
993f845301
Add a simple benchmark
...
Shuffle some of the test support code into support/mod.rs so it can
be used in benchmarks also
2020-08-03 21:08:17 -04:00
Jack Lloyd
2d8098ad84
More ratchet tests
...
Enable some pre-existing tests which were disabled due to bad cfg()
Add some ratchet tests from libsignal-protocol-java which were missed
2020-08-03 21:07:12 -04:00
Jack Lloyd
ab1e9f373a
New fmt behavior
2020-08-03 17:21:27 -04:00
Jack Lloyd
d4d867f748
Remove dead code
...
The Java equivalent of remove_previous_session_states is also dead - not called
within either the lib itself nor by Signal-Android.
The previous_counter field in SignalMessage seems to be dead and I don't
understand its purpose. It is similar dead in the Java code (read, but not used
anywhere within the class and not exposed via a getter).
Unrelated, export HKDF as Signal-Android uses HKDF via libsignal
Now dead code is also prohibited. modulo the previous_counter field.
2020-08-03 17:21:27 -04:00
Jack Lloyd
67ead624a9
Expose a few fingerprint functions as public API
2020-08-03 15:26:05 -04:00
Jack Lloyd
bc5dec2d9c
Run clippy in CI
2020-07-30 15:06:49 -04:00
Jack Lloyd
a98ec0a84e
Move verify_signature and calculate_agreement onto the relevant structs
...
Since these functions are needed for FFI bindings and it makes sense
for them to exist on the struct itself
2020-07-30 13:49:20 -04:00
Jack Lloyd
b6fcd32ae3
Ignore editor backups
2020-07-30 13:49:20 -04:00
Jack Lloyd
2ef8c0888c
Fix clippy warnings
2020-07-30 13:49:20 -04:00
Jack Lloyd
175689382e
Add LICENSE and README files
2020-07-30 13:49:20 -04:00
Jack Lloyd
9d4bebcee7
Move arbitrary constants to consts.rs
2020-07-28 15:37:54 -04:00
Jack Lloyd
b30bec68cd
Remove SenderKeyName::serialize
2020-07-28 15:19:53 -04:00
Jack Lloyd
0191ec0408
Clean up error handling surrounding AES encryption
2020-07-28 15:19:53 -04:00
Jack Lloyd
286cb46578
Add group tests ported from Java
2020-07-28 15:19:53 -04:00
Jack Lloyd
677a529ab3
Add group cipher logic
2020-07-28 15:19:53 -04:00
Jack Lloyd
187fc261f8
Implement SenderKeyStore for InMemSignalProtocolStore
2020-07-28 15:19:53 -04:00
Jack Lloyd
b95f7beb12
Add logic for handling sender keys
2020-07-28 15:19:53 -04:00
Jack Lloyd
1e35fe0956
Implement SenderKeyDistributionMessage
2020-07-28 15:19:53 -04:00
Jack Lloyd
7e16c12cf2
Add some Error types
2020-07-28 15:19:53 -04:00
Jack Lloyd
1bfcd9c11e
Move most crypto goop to crypto.rs
2020-07-28 15:19:53 -04:00
Jack Lloyd
1efcf6966a
Update src/session_cipher.rs
...
Eliminate unnecessary return
Co-authored-by: Ehren Kret <ehren@signal.org>
2020-07-23 13:13:32 -04:00
Jack Lloyd
61d3bbefe9
Add the simultaneous initiate tests
2020-07-23 13:13:32 -04:00
Jack Lloyd
9e4319f625
Add tests from SessionCipherTests.java
...
Fix a bug where we pushed message keys on the wrong end of the vec
2020-07-22 12:11:03 -04:00
Jack Lloyd
50356597e2
More tests
2020-07-22 12:11:03 -04:00
Jack Lloyd
56a8f2ee12
Remove commented out Java code
2020-07-22 12:11:03 -04:00
Jack Lloyd
61ab9aedbf
Address review comments
2020-07-22 12:11:03 -04:00
Jack Lloyd
31f530bd8d
Add initial integration tests
2020-07-22 12:11:03 -04:00
Jack Lloyd
ffe8ffc051
Add SessionCipher
2020-07-22 12:11:03 -04:00
Jack Lloyd
415e187d25
Flatten out SessionBuilder
...
It is - besides the references to the objects stores - stateless.
But the SessionBuilder holding a mut reference makes other code
difficult to write due to the borrow checker.
Instead just make SessionBuilder functionality plain old functions
and have them take the needed datastores as arguments
2020-07-22 12:11:03 -04:00
Jack Lloyd
f36029083a
Add more public crate exports
2020-07-22 12:11:03 -04:00
Jack Lloyd
7d9d9157b9
Add IdentityKeyPair::public_key
2020-07-22 12:11:03 -04:00
Jack Lloyd
a24cb8810b
Fix some bugs and add missing functions for SessionState
2020-07-22 12:11:03 -04:00
Jack Lloyd
336023ed1c
Add ProtocolStore trait
2020-07-22 12:11:03 -04:00
Jack Lloyd
6be04ea084
Add some helpers for message types
2020-07-22 12:11:03 -04:00
Jack Lloyd
1441c848ab
Add some useful error types
2020-07-22 12:11:03 -04:00
Jack Lloyd
805f2606b9
Add some convenience forwarding functions on curve
2020-07-22 12:11:03 -04:00
Jack Lloyd
db6424d302
Make MessageKeys/ChainKey Copy+Clone+Debug
2020-07-22 12:11:03 -04:00
Jack Lloyd
e8d51c3273
Add .rustfmt.toml to set edition
2020-07-14 16:36:49 -04:00
Jack Lloyd
b97fd4a84c
apply rustfmt
2020-07-14 16:36:49 -04:00
Jack Lloyd
8ea091c3db
Add rustfmt check
2020-07-14 16:36:49 -04:00
Jack Lloyd
20e437e110
Fix typo in enum
2020-07-14 14:17:03 -04:00
Jack Lloyd
b207b7f95e
Address some review comments
2020-07-14 14:14:22 -04:00
Jack Lloyd
b0c1eae954
Add logic for session initiation
...
Equivalent of SessionBuilder and RatchetSession in Java code
2020-07-14 14:14:22 -04:00
Jack Lloyd
9977fc1dbe
Implement some missing functions on SessionState
...
Also fix a few warnings
2020-07-14 14:14:22 -04:00
Jack Lloyd
af122ba409
Add PreKeyBundle
2020-07-14 14:14:22 -04:00
Jack Lloyd
7ff4bb4113
Export more of the API from the crate
2020-07-14 14:14:22 -04:00
Jack Lloyd
6f4ce178d9
Make KeyPair Copy and Clone
2020-07-14 14:14:22 -04:00
Jack Lloyd
e3f6cd28a2
Add some useful Error types
2020-07-14 14:14:22 -04:00
Jack Lloyd
c4a662ec99
impl Display for ProtocolAddress
2020-07-14 14:14:22 -04:00
Jack Lloyd
b9f1c755cd
Add SessionRecord
2020-07-10 13:11:42 -04:00