0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 03:52:17 +02:00
Commit Graph

22 Commits

Author SHA1 Message Date
Alex Konradi
9db74365d9
Implement Debug and PartialEq for more types 2024-04-19 10:10:09 -04:00
Alex Konradi
fcdd48bb54
Derive std::error::Error for more types
Also make use of displaydoc::Display and generated From impls in more places.
2024-04-17 10:37:19 -04:00
Rolfe Schmidt
a31ca5d79a
Add all E values to endorsements Fiat-Shamir transform challenge calculation 2024-04-02 16:06:43 -06:00
Jordan Rose
fca9196201 GroupSendEndorsements: don't fall over in the face of 1-person groups
Previously we'd attempt to create a combination of zero endorsements
for the everybody-but-me credential, and panic (throw an error). Now
we correctly create an endorsement that represents zero people, which
is better than returning some dummy value because it behaves
reasonably if endorsements from multiple groups are combined wholesale
(not something we plan to do, but something that shouldn't have weird
edge cases if we end up needing to).
2024-03-18 09:59:16 -07:00
Jordan Rose
1e635f1fa3 zkcredential: Keep compressed *and* decompressed endorsements around
This saves work for callers that need both, which includes
GroupSendEndorsement: after receiving and validating the endorsements,
they need to get serialized and sent back up to the app layer to put
in its database (compressed), but we also generate an extra
"everyone-but-me" endorsement from the results (decompressed).

This saves quite a bit of time in the app-layer benchmarks, since they
include the cost of serialization.
2024-03-14 13:32:26 -07:00
Alex Konradi
f4f478fd06
Add authentication credential implemented with zkc
Add a new version of the existing auth credential used for groups, but 
implemented with the zkcredential crate instead of hand-written proofs. Expose 
issuance point for the server, and extend existing client methods to support it 
and the existing formats transparently.
2024-03-08 15:38:23 -05:00
Jordan Rose
1c8fd06486 zkgroup: Implement GroupSendEndorsements
This involves a family of new types that will be used for issuing and
verifying these endorsements.

This is a breaking change for zkgroup: it adds a new key to
ServerSecretParams and ServerPublicParams.
2024-03-06 12:22:38 -08:00
Jordan Rose
4d5ae34c1a Make "endorsements" the name of the New thing, instead of "passes"
And demote the thing we called "pass" to a plain bag of bytes, like a
hash.
2024-02-21 18:09:45 -08:00
Jordan Rose
6d8f559df8
Implement 3HashSDHI-based "passes" in zkcredential
(further tweaks to come)
2024-02-20 16:33:12 -08:00
Jordan Rose
0d09a8352c
Add GroupSendCredential
This credential is issued by the group server and presented to the
chat server to prove that the holder is a member of *some* group with
a known list of people. This can be used to replace the access key
requirement for multi-recipient sealed sender sends.
2023-12-11 13:45:12 -08:00
Jordan Rose
b0a61dbcca Add PartialDefault to most zkcredential and zkgroup types 2023-10-31 12:38:43 -07:00
Jordan Rose
22123a070c zkcredential: Don't provide a default for KeyPair::G_a
Instead, require clients to provide storage to cache this value if
they want to use the default implementation. This noticeably speeds up
KeyPair::inverse_of, and provides a benefit to generating and
verifying presentation proofs as well.
2023-10-30 16:53:25 -07:00
Jordan Rose
d68fe94cb1 zkcredential: Add a benchmark for KeyPair::inverse_of 2023-10-30 16:53:25 -07:00
Jordan Rose
0f83996da2 zkcredential: Add add_attribute_without_verified_key
This omits the public key of an encrypted attribute from a
presentation proof, meaning the verifying server will see that the
attribute has been "correctly" encrypted, but cannot verify which key
was used to perform that encryption.
2023-10-16 13:12:12 -07:00
Jordan Rose
7e746f19cf zkcredential: Add KeyPair::inverse_of
This will be used for credentials issued on ciphertexts and presented
on plaintexts.
2023-10-13 12:33:04 -07:00
Jordan Rose
cb9bbfeed4 Add concrete KeyPair+PublicKey to zkcredential; use them in zkgroup
Previously, zkcredential declared traits 'KeyPair' and 'PublicKey',
which could be implemented to provide custom encryption keys for the
homomorphic encryption used in credentials. However, those keys still
had to be consistent with the proofs generated by zkcredential, and
they ended up looking the same for every attribute type...except in
their decryption.

Now, clients like zkgroup implement a 'Domain' trait to provide the
generator points and type safety for a key, and can reuse
zkcredential's KeyPair, PublicKey, and Ciphertext types. The 'decrypt'
operation still has to be provided on a per-type basis, unfortunately.

The code size and performance impact is below the noise threshold.

This commit CHANGES THE SERDE REPRESENTATION for zkgroup KeyPairs,
including those embedded in types like GroupSecretParams.
Serializations using bincode, including Signal's, will not see any
change, but serializing using another serde implementation will result
in different structure in the KeyPair type.
2023-10-13 12:33:04 -07:00
akonradi-signal
80ce525e69
Hold Cow<'static, str> in poksho structs
Replace the String values with Cow<'static, str> which lets us hold references
to static strings without copying them onto the heap. Since most added values
are static, this should save on heap usage and runtime cost.
2023-10-03 16:18:04 -04:00
akonradi-signal
d07b90f603
Fix Rust documentation
Fix warnings identified by cargo doc and require that the docs build successfully in the future.
2023-09-15 12:17:29 -04:00
akonradi-signal
9752b6e9fa
Use hex! for binary strings in zkgroup and zkcredential 2023-09-13 14:45:21 -04:00
akonradi-signal
ef542e3b9f
Bump rust compiler version to nightly 2023-09-01 2023-09-12 14:27:08 -04:00
moiseev-signal
716e683324
Update dependencies following curve25519-dalek 4.0.0 release
Co-authored-by: Jordan Rose <jrose@signal.org>
2023-08-09 15:04:41 -07:00
Jordan Rose
b7f11ac0f1
Introduce zkcredential crate
zkcredential provides APIs for a generic form of the sort of credentials zkgroup supports
2023-04-17 11:10:02 -07:00