Skip to content

Commit 12fa359

Browse files
committed
Make session keys serializable
1 parent 3093138 commit 12fa359

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "libpep"
33
edition = "2021"
4-
version = "0.7.1"
4+
version = "0.7.3"
55
authors = ["Bernard van Gastel <bvgastel@bitpowder.com>", "Job Doesburg <job@jobdoesburg.nl>"]
66
homepage = "https://github.com/NOLAI/libpep"
77
repository = "https://github.com/NOLAI/libpep"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nolai/libpep-wasm",
3-
"version": "0.7.1",
3+
"version": "0.7.3",
44
"description": "The WebAssembly version of the libpep library",
55
"repository": {
66
"type": "git",

src/lib/distributed/systems.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ impl PEPClient {
231231
old_key_shares: SessionKeyShares,
232232
new_key_shares: SessionKeyShares,
233233
) {
234-
self.keys = update_session_keys(self.keys.clone(), old_key_shares, new_key_shares);
234+
self.keys = update_session_keys(self.keys, old_key_shares, new_key_shares);
235235
}
236236

237237
/// Get the appropriate public key for a given message type.

src/lib/high_level/keys.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,33 +50,33 @@ pub struct GlobalSecretKeys {
5050
#[derive(Copy, Clone, Eq, PartialEq, Debug, Deref, From, Serialize, Deserialize)]
5151
pub struct PseudonymSessionPublicKey(pub(crate) GroupElement);
5252
/// A session secret key used to decrypt pseudonyms with.
53-
#[derive(Copy, Clone, Debug, From)]
53+
#[derive(Copy, Clone, Debug, From, Eq, PartialEq)]
5454
pub struct PseudonymSessionSecretKey(pub(crate) ScalarNonZero);
5555

5656
/// A session public key used to encrypt attributes against, associated with a [`AttributeSessionSecretKey`].
5757
#[derive(Copy, Clone, Eq, PartialEq, Debug, Deref, From, Serialize, Deserialize)]
5858
pub struct AttributeSessionPublicKey(pub(crate) GroupElement);
5959
/// A session secret key used to decrypt attributes with.
60-
#[derive(Copy, Clone, Debug, From)]
60+
#[derive(Copy, Clone, Debug, From, Eq, PartialEq)]
6161
pub struct AttributeSessionSecretKey(pub(crate) ScalarNonZero);
6262

6363
/// A pseudonym session key pair containing both public and secret keys.
64-
#[derive(Copy, Clone, Debug)]
64+
#[derive(Copy, Clone, Eq, PartialEq, Debug, From, Serialize, Deserialize)]
6565
pub struct PseudonymSessionKeys {
6666
pub public: PseudonymSessionPublicKey,
6767
pub secret: PseudonymSessionSecretKey,
6868
}
6969

7070
/// An attribute session key pair containing both public and secret keys.
71-
#[derive(Copy, Clone, Debug)]
71+
#[derive(Copy, Clone, Eq, PartialEq, Debug, From, Serialize, Deserialize)]
7272
pub struct AttributeSessionKeys {
7373
pub public: AttributeSessionPublicKey,
7474
pub secret: AttributeSessionSecretKey,
7575
}
7676

7777
/// Session keys for both pseudonyms and attributes.
7878
/// Organized by key type (pseudonym/attribute) rather than by public/secret.
79-
#[derive(Clone, Debug)]
79+
#[derive(Copy, Clone, Eq, PartialEq, Debug, From, Serialize, Deserialize)]
8080
pub struct SessionKeys {
8181
pub pseudonym: PseudonymSessionKeys,
8282
pub attribute: AttributeSessionKeys,

0 commit comments

Comments
 (0)