Skip to content

Commit

Permalink
Updates changelog for 0.4.0-alpha.x
Browse files Browse the repository at this point in the history
  • Loading branch information
KPrasch committed Sep 7, 2022
1 parent a2e8061 commit 34a5e74
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.0
current_version = 0.3.1-alpha.0
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(-(?P<stage>[^.]*)\.(?P<devnum>\d+))?
Expand Down
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Under Construction
- The Python module `nucypher_core.umbral` now exports `KeyFrag`. ([#20])
- `Display` impl for `HRAC` and `FleetStateChecksum`, and exposed it in the Python and WASM bindings. ([#22])


[#17]: https://github.com/nucypher/nucypher-core/pull/17
[#20]: https://github.com/nucypher/nucypher-core/pull/20
[#22]: https://github.com/nucypher/nucypher-core/pull/22
Expand Down
2 changes: 1 addition & 1 deletion nucypher-core-python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "nucypher-core-python"
authors = ["Bogdan Opanchuk <bogdan@opanchuk.net>"]
version = "0.3.0"
version = "0.3.1-alpha.0"
edition = "2018"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion nucypher-core-python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
description="Protocol structures of Nucypher network",
long_description=long_description,
long_description_content_type="text/markdown",
version="0.3.0",
version="0.3.1-alpha.0",
author="Bogdan Opanchuk",
author_email="bogdan@opanchuk.net",
url="https://github.com/nucypher/nucypher-core/tree/master/nucypher-core-python",
Expand Down
2 changes: 1 addition & 1 deletion nucypher-core-wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nucypher-core-wasm"
version = "0.3.0"
version = "0.3.1-alpha.0"
authors = [
"Bogdan Opanchuk <bogdan@opanchuk.net>",
"Piotr Roslaniec <p.roslaniec@gmail.com>"
Expand Down
2 changes: 1 addition & 1 deletion nucypher-core-wasm/package.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Bogdan Opanchuk <bogdan@opanchuk.net>"
],
"description": "NuCypher network core data structures",
"version": "0.3.0",
"version": "0.3.1-alpha.0",
"license": "GPL-3.0-only",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion nucypher-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nucypher-core"
version = "0.3.0"
version = "0.3.1-alpha.0"
authors = ["Bogdan Opanchuk <bogdan@opanchuk.net>"]
edition = "2021"
license = "GPL-3.0-only"
Expand Down
40 changes: 14 additions & 26 deletions nucypher-core/src/reencryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use umbral_pre::{

use crate::hrac::HRAC;
use crate::key_frag::EncryptedKeyFrag;
use crate::VerificationError;
use crate::versioning::{
messagepack_deserialize, messagepack_serialize, ProtocolObject, ProtocolObjectInner,
};
use crate::VerificationError;

/// A request for an Ursula to reencrypt for several capsules.
#[derive(PartialEq, Debug, Serialize, Deserialize)]
Expand Down Expand Up @@ -106,7 +106,7 @@ impl ReencryptionResponse {
pub fn new(
signer: &Signer,
capsules: &[Capsule],
vcfrags: impl IntoIterator<Item=VerifiedCapsuleFrag>,
vcfrags: impl IntoIterator<Item = VerifiedCapsuleFrag>,
) -> Self {
// un-verify
let cfrags: Vec<_> = vcfrags
Expand Down Expand Up @@ -191,11 +191,10 @@ impl<'a> ProtocolObjectInner<'a> for ReencryptionResponse {

impl<'a> ProtocolObject<'a> for ReencryptionResponse {}


#[cfg(test)]
mod tests {
use umbral_pre::{encrypt, generate_kfrags, Signer};
use umbral_pre::SecretKey;
use umbral_pre::{encrypt, generate_kfrags, Signer};

use crate::{EncryptedKeyFrag, HRAC};

Expand All @@ -213,30 +212,20 @@ mod tests {

let (capsule, _ciphertext) = encryption_result.unwrap();

let hrac = HRAC::new(
&some_trinket,
&another_trinket,
&[42],
);
let hrac = HRAC::new(&some_trinket, &another_trinket, &[42]);

let signer = Signer::new(SecretKey::random());

let verified_kfrags = generate_kfrags(
&some_secret,
&another_trinket,
&signer,
5,
8,
true,
true,
);
let verified_kfrags =
generate_kfrags(&some_secret, &another_trinket, &signer, 5, 8, true, true);
let verified_kfrags_vector = verified_kfrags.into_vec();
let one_verified_krag_in_particular = verified_kfrags_vector[0].clone();
let encrypted_kfrag = EncryptedKeyFrag::new(&signer,
&another_trinket,
&hrac,
one_verified_krag_in_particular);

let encrypted_kfrag = EncryptedKeyFrag::new(
&signer,
&another_trinket,
&hrac,
one_verified_krag_in_particular,
);

let request = ReencryptionRequest::new(
&[capsule],
Expand All @@ -250,8 +239,7 @@ mod tests {
let conditions = request.conditions.unwrap();
assert!(conditions[0].eq(&47u8));

let context= request.context.unwrap();
let context = request.context.unwrap();
assert!(context[0].eq(&51u8));

}
}
}

0 comments on commit 34a5e74

Please sign in to comment.