diff --git a/Cargo.lock b/Cargo.lock index 3052b20e..2822156a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -742,22 +742,22 @@ dependencies = [ [[package]] name = "ferveo-common-pre-release" -version = "0.1.0-alpha.0" +version = "0.1.0" dependencies = [ "ark-bls12-381", "ark-ec", "ark-serialize", "ark-std", "bincode", + "generic-array", "rand 0.8.5", - "rand_core 0.6.4", "serde", "serde_with", ] [[package]] name = "ferveo-pre-release" -version = "0.1.0-alpha.10" +version = "0.2.0" dependencies = [ "ark-bls12-381", "ark-ec", @@ -794,7 +794,7 @@ dependencies = [ [[package]] name = "ferveo-python" -version = "0.1.0-alpha.0" +version = "0.1.0" dependencies = [ "ferveo-pre-release", "pyo3", @@ -803,7 +803,7 @@ dependencies = [ [[package]] name = "ferveo-wasm" -version = "0.1.0-alpha.1" +version = "0.1.0" dependencies = [ "ferveo-pre-release", "itertools", @@ -881,7 +881,7 @@ checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" [[package]] name = "group-threshold-cryptography-pre-release" -version = "0.1.0-alpha.0" +version = "0.1.0" dependencies = [ "ark-bls12-381", "ark-ec", @@ -1792,7 +1792,7 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subproductdomain-pre-release" -version = "0.1.0-alpha.0" +version = "0.1.0" dependencies = [ "anyhow", "ark-bls12-381", diff --git a/ferveo-common/CHANGELOG.md b/ferveo-common/CHANGELOG.md new file mode 100644 index 00000000..cadc543e --- /dev/null +++ b/ferveo-common/CHANGELOG.md @@ -0,0 +1,126 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.1.0 (2023-07-07) + + + + + +### Other + + - Made ferveo-common wasm compatible (a tiny change). Fixes a world of pain upstream in Anoma + - Formatting + - Removed the announce phase from the dkg + +### Chore + + - adjust changelogs for cargo-smart-release + +### Commit Statistics + + + + - 82 commits contributed to the release over the course of 652 calendar days. + - 4 commits were understood as [conventional](https://www.conventionalcommits.org). + - 4 unique issues were worked on: [#68](https://github.com/nucypher/ferveo/issues/68), [#70](https://github.com/nucypher/ferveo/issues/70), [#71](https://github.com/nucypher/ferveo/issues/71), [#72](https://github.com/nucypher/ferveo/issues/72) + +### Commit Details + + + +
view details + + * **[#68](https://github.com/nucypher/ferveo/issues/68)** + - Simplify validator sets in dkg state machine ([`73b729a`](https://github.com/nucypher/ferveo/commit/73b729a523b391d40e7a9fe4cbbcdb17557cf089)) + * **[#70](https://github.com/nucypher/ferveo/issues/70)** + - Dkg State Machine refactor ([`8594316`](https://github.com/nucypher/ferveo/commit/85943169e27d7dbbdce835d6563ac4d838a410e1)) + * **[#71](https://github.com/nucypher/ferveo/issues/71)** + - Added serialization/deserialization to the dkg state machine ([`653be13`](https://github.com/nucypher/ferveo/commit/653be13c8a9d7de2e98ac76eca3aadf8f8cadf4a)) + * **[#72](https://github.com/nucypher/ferveo/issues/72)** + - Refactor subproductdomain ([`2d8026b`](https://github.com/nucypher/ferveo/commit/2d8026b2299fd9b67c77fb3b4e565ff9f4e6505b)) + * **Uncategorized** + - Adjust changelogs for cargo-smart-release ([`0eb5bd4`](https://github.com/nucypher/ferveo/commit/0eb5bd48b598709dd0fc54adb424f5f41ce52e92)) + - Release 0.1.0 crate versions ([`c02e305`](https://github.com/nucypher/ferveo/commit/c02e3050b7a9dcf0260a5eb4e42ff74f3788c3bf)) + - Release ferveo-common-pre-release@0.1.0-alpha.1 ([`2725ba4`](https://github.com/nucypher/ferveo/commit/2725ba455e2ae169af5be64c5f2261ec0c5ea648)) + - Merge pull request #136 from nucypher/pk-static-bytes ([`2b64c2e`](https://github.com/nucypher/ferveo/commit/2b64c2e8e5e594acffde734b65d212fde3df99e9)) + - Remove unused crate ([`4939e79`](https://github.com/nucypher/ferveo/commit/4939e79fd336a08547984d66dd0f7a256ab9dcf7)) + - Feat! use static arrays in ferveo public key serialization ([`f9ac1d7`](https://github.com/nucypher/ferveo/commit/f9ac1d70b0fc7df286438fa817537c31cb9e7682)) + - Merge pull request #119 from nucypher/nucypher-core-integration ([`52c1f27`](https://github.com/nucypher/ferveo/commit/52c1f27627798fa266d2e5079f5121cc71e8e284)) + - Merge pull request #118 from nucypher/expose-bindings-from-main-crate ([`11d6cea`](https://github.com/nucypher/ferveo/commit/11d6ceaf26f45c76dec0c5a9fcf5eae5301502d3)) + - Fix wasm locals exceeded ([`ac91e83`](https://github.com/nucypher/ferveo/commit/ac91e8359df44b72e5863da74ac71fe54f8eba81)) + - Release pre-release crates ([`8df87ff`](https://github.com/nucypher/ferveo/commit/8df87ff36ac81bd9e60013cda892d31ddf402868)) + - Apply changes for nucypher-core integration ([`b69949c`](https://github.com/nucypher/ferveo/commit/b69949ca53b24d7f5fc4e71f3a0d7ca8e5d8d034)) + - Update crates to 2021 edition #111 ([`591c05e`](https://github.com/nucypher/ferveo/commit/591c05e64ef9d2f7218418b6aa9d33181c60c88f)) + - Move utils ([`98c49d1`](https://github.com/nucypher/ferveo/commit/98c49d18cee607395ffb65ad0e1dd8e863d28f94)) + - Move wasm bindings ([`7cfe558`](https://github.com/nucypher/ferveo/commit/7cfe55819ca4ae619c46cb63b0668225591931cd)) + - Merge remote-tracking branch 'upstream/main' into zeroize ([`c9b230a`](https://github.com/nucypher/ferveo/commit/c9b230aa011cc537d7d5dcee84cd63a595b471cc)) + - Merge pull request #109 from piotr-roslaniec/static-arrays ([`e75e8b8`](https://github.com/nucypher/ferveo/commit/e75e8b86e228b5456a613d1f4ffd03d2540e23b1)) + - Remove unused packages ([`24d8fb4`](https://github.com/nucypher/ferveo/commit/24d8fb451e244e0ad9287e1ae30b72ffeeb5254b)) + - Ensure dkg pk is serialized to 48 bytes ([`5570c0d`](https://github.com/nucypher/ferveo/commit/5570c0d5bb2ee7a64eac78861c4999d9c98f455a)) + - Merge pull request #102 from piotr-roslaniec/local-verification-wasm ([`aacdf04`](https://github.com/nucypher/ferveo/commit/aacdf0462d73720e97c1d7924fc49e3d252a691a)) + - Js bindings fail to correctly decrypt the ciphertext ([`ae79060`](https://github.com/nucypher/ferveo/commit/ae790601f691a7727489dbd8606dcd6ed0e4106d)) + - Update wasm bindings ([`9215238`](https://github.com/nucypher/ferveo/commit/9215238e30987c13cbe66d4c05b118f9ff49d815)) + - Js bindings fail to correctly decrypt the ciphertext ([`3e7db72`](https://github.com/nucypher/ferveo/commit/3e7db72e5878bfc54b0324c4c79a2a058fc9e0e9)) + - Update wasm bindings ([`1cc7036`](https://github.com/nucypher/ferveo/commit/1cc7036007c05c231f241047ef01e394b8710205)) + - Merge pull request #93 from piotr-roslaniec/local-verification ([`a6ff917`](https://github.com/nucypher/ferveo/commit/a6ff91794d5a8ddd2b9ffcb7b398f58039017a96)) + - Update python bindings ([`a77fc7a`](https://github.com/nucypher/ferveo/commit/a77fc7ac4aa4e2b5bd9a45faa44e40792fc8b65e)) + - Merge branch 'main' into local-verification ([`dd1eccf`](https://github.com/nucypher/ferveo/commit/dd1eccf1575d98d5bec2486452d3aa435faa02da)) + - Merge pull request #100 from piotr-roslaniec/expose-dkg-pk-size ([`bd72ef5`](https://github.com/nucypher/ferveo/commit/bd72ef560fc85defbce29e4de9a8d9bc676239f5)) + - Expose size of dkg public key in bindings ([`661780c`](https://github.com/nucypher/ferveo/commit/661780ce1292ed562828b2ad526de4f4b864e6ac)) + - Merge pull request #95 from piotr-roslaniec/implicit-ordering ([`9fded5b`](https://github.com/nucypher/ferveo/commit/9fded5bbd7b85985644844d31cf391dce52aea97)) + - Sort validator by their address ([`f6cf412`](https://github.com/nucypher/ferveo/commit/f6cf4125f3d2a767eeb98df1db8bd4b69ccdc222)) + - Refactor for 1.64.0 msrv ([`a23500c`](https://github.com/nucypher/ferveo/commit/a23500ca3918cf9456709340b00e1a54f651bb05)) + - Fix examples ([`2d96a30`](https://github.com/nucypher/ferveo/commit/2d96a30778b44335680c508538dc254114439451)) + - Refactor internal ordering tracking ([`6bb4746`](https://github.com/nucypher/ferveo/commit/6bb4746ab1b2c7b0cd3ae7336fb5d8e5415b1abe)) + - Establish the correct ordering with sorting ([`0fd1859`](https://github.com/nucypher/ferveo/commit/0fd1859a2d8dc8ece2fdd576d5fa3e5845ffb53a)) + - Merge pull request #75 from nucypher/release-ferveo-py ([`2529f74`](https://github.com/nucypher/ferveo/commit/2529f743fe6f07935938cbef81faa0230e478f87)) + - Test keypair generation ([`d2b6c30`](https://github.com/nucypher/ferveo/commit/d2b6c30d3c39d79ef17b8649a0410e32236b12ae)) + - Add Keypair::from_secure_randomness method ([`62755ed`](https://github.com/nucypher/ferveo/commit/62755ed05e241adf2187f52ac2586cd32e416ca1)) + - Merge pull request #56 from nucypher/ferveo-light-tdec ([`8fa25b6`](https://github.com/nucypher/ferveo/commit/8fa25b66bf32585b2ef406bbec3999fd9ce75225)) + - Merge pull request #62 from nucypher/client-server-api ([`3a6e3c4`](https://github.com/nucypher/ferveo/commit/3a6e3c4b59c192289f86c0e37f119b29ccd3d620)) + - Merge pull request #67 from nucypher/arkworks-0.4 ([`bd78f97`](https://github.com/nucypher/ferveo/commit/bd78f9741246a2118bf6e3fdf48c72d6adf51b9e)) + - Merge pull request #68 from nucypher/error-handling ([`093f17e`](https://github.com/nucypher/ferveo/commit/093f17e22f606b33a468bd62ad37cf22f3dda265)) + - Merge branch 'error-handling' into tpke-wasm-api-example ([`707f460`](https://github.com/nucypher/ferveo/commit/707f460666acc2781d6dcfa49e0f75f1159f466f)) + - Merge branch 'error-handling' into release-ferveo-py ([`d2a0ca0`](https://github.com/nucypher/ferveo/commit/d2a0ca045beb4dd298f2c06b20b313456a1e81f9)) + - Sketch error handling in ferveo ([`a68d2d9`](https://github.com/nucypher/ferveo/commit/a68d2d9b62414fd06afa234f240508d1c41e68a8)) + - Refactor serialization ([`b9535fe`](https://github.com/nucypher/ferveo/commit/b9535fefae0795f4b43f726378c5c65d0e776937)) + - Trim external apis ([`0b95048`](https://github.com/nucypher/ferveo/commit/0b9504833ff4025236d9821c5bdc40e66f6774d6)) + - Replace unwrap calls with result type ([`a9b4331`](https://github.com/nucypher/ferveo/commit/a9b4331c3755a0bb0dc0ca5cc355a892dc13d7d3)) + - Remove unused crates ([`f876b85`](https://github.com/nucypher/ferveo/commit/f876b85732a31970a421f1a75c54a2a17aa48e95)) + - Update arkworks to 0.4.0 - first pass ([`b1999b8`](https://github.com/nucypher/ferveo/commit/b1999b86a2b04c719ec29b1263612de88a0cfd49)) + - Fix import style ([`6d92b01`](https://github.com/nucypher/ferveo/commit/6d92b010139b915da1a89ffa686bf24871c7afd1)) + - Simple tdec on client side fails ([`7257843`](https://github.com/nucypher/ferveo/commit/7257843a9722f4a63bfbe82fcfbaf2088711dfb6)) + - Add ferveo-python example ([`fd47f97`](https://github.com/nucypher/ferveo/commit/fd47f97510fad4132712dc58714c19fc0fd0d7e4)) + - Merge branch 'main' into use-sha256 ([`fa1c1a8`](https://github.com/nucypher/ferveo/commit/fa1c1a8bf2b338cb379a481d8b042c45af23c470)) + - Merge pull request #27 from nucypher/dkg-pvss-flow ([`e842b8a`](https://github.com/nucypher/ferveo/commit/e842b8a5bb2cafe2e768ca29e5f0210f969ea748)) + - Documents and refactor code ([`6fb4c89`](https://github.com/nucypher/ferveo/commit/6fb4c890cef5c1ca077d301bf4e3e12c78584d39)) + - Remove unused code ([`002d407`](https://github.com/nucypher/ferveo/commit/002d407d1f592af1de836af1f5030b9baa423b90)) + - Rename TendermintValidator to ExternalValidator ([`8bd2888`](https://github.com/nucypher/ferveo/commit/8bd2888a95ec91686ce8e62da1533459dc159469)) + - Remove ValidatorSet ([`60e4c6f`](https://github.com/nucypher/ferveo/commit/60e4c6f26c6cc2041ba66cd6697db3bae66ff04e)) + - Simple threshold decryption works ([`d3c76cd`](https://github.com/nucypher/ferveo/commit/d3c76cde43f13a9a7c24d24511acbd980b5b6e44)) + - Initial removal of share partitioning ([`ab2857d`](https://github.com/nucypher/ferveo/commit/ab2857d7d30627753ca2ae2a3550284d73d56fec)) + - Documents and refactor code ([`8f7308b`](https://github.com/nucypher/ferveo/commit/8f7308b380483349dc744cc6665b7f7bc9412ded)) + - Remove unused code ([`fb05e62`](https://github.com/nucypher/ferveo/commit/fb05e62fdb784b5b68b80040677a01386eb61141)) + - Rename TendermintValidator to ExternalValidator ([`995fdce`](https://github.com/nucypher/ferveo/commit/995fdcedf42ee3bacdd66689852fcc2f3d5f9794)) + - Remove ValidatorSet ([`4f62c70`](https://github.com/nucypher/ferveo/commit/4f62c704156c9929754bf16a5fd801bf9908ba3f)) + - Simple threshold decryption works ([`856790c`](https://github.com/nucypher/ferveo/commit/856790c48d882c87275ddf6d87bbeb1a31ad559b)) + - Initial removal of share partitioning ([`9d38f62`](https://github.com/nucypher/ferveo/commit/9d38f62f5ae7f4a4b25e149e84aad77a02bc4a03)) + - Merge pull request #10 from piotr-roslaniec/wasm-bindings ([`f26552d`](https://github.com/nucypher/ferveo/commit/f26552db645e095fb4df6732aa38e1fff1401d72)) + - Update after rebase ([`b8b2392`](https://github.com/nucypher/ferveo/commit/b8b2392de11068acde07895dc9b6897a742b9b2d)) + - Add wasm setup ([`ca2e46e`](https://github.com/nucypher/ferveo/commit/ca2e46e67637ce34d531da03124523fb567b7002)) + - Merge pull request #8 from piotr-roslaniec/aad#1 ([`41b5408`](https://github.com/nucypher/ferveo/commit/41b54081c2061126fa8d661207e13aa74406733f)) + - Address some clippy warnings ([`e8087d2`](https://github.com/nucypher/ferveo/commit/e8087d23ec6d1845585016259e51cc173160bb92)) + - Merge pull request #76 from anoma/bat/ferveo-common-canonical-serialize ([`8363c33`](https://github.com/nucypher/ferveo/commit/8363c33d1cf79f93ce9fa89d4b5fe998a5a78c26)) + - Made ferveo-common wasm compatible (a tiny change). Fixes a world of pain upstream in Anoma ([`ab67016`](https://github.com/nucypher/ferveo/commit/ab6701666e3b05bd783ce0309025e842fa83e4c1)) + - Merge pull request #73 from anoma/bat/announcement-refactor ([`9786ac0`](https://github.com/nucypher/ferveo/commit/9786ac0c9d70f0b73fb2303405db730c98e06440)) + - Formatting ([`d786fae`](https://github.com/nucypher/ferveo/commit/d786fae33b01cd0863f29b70810dfcc847f2542b)) + - Removed the announce phase from the dkg ([`ec58fe1`](https://github.com/nucypher/ferveo/commit/ec58fe1828d0560525c80cd1dc4013915b0ac54e)) + - Merge pull request #65 from anoma/joe/20210922 ([`d6d603f`](https://github.com/nucypher/ferveo/commit/d6d603fbe82706525a194f42cbab9c3431dd7cc4)) + - Latest ferveo ([`0f17c3b`](https://github.com/nucypher/ferveo/commit/0f17c3be5cfa55b5f878defcb74ab2b4e13c3190)) +
+ diff --git a/ferveo-common/Cargo.toml b/ferveo-common/Cargo.toml index c5b5a58e..5f3a6f4c 100644 --- a/ferveo-common/Cargo.toml +++ b/ferveo-common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ferveo-common-pre-release" -version = "0.1.0-alpha.0" +version = "0.1.0" edition = "2021" license = "GPL-3.0" authors = ["Heliax AG ", "Piotr Roslaniec "] @@ -11,8 +11,8 @@ ark-ec = "0.4" ark-serialize = { version = "0.4", features = ["derive"] } ark-std = "0.4" bincode = "1.3.3" +generic-array = "0.14.7" rand = "0.8" -rand_core = "0.6" serde = { version = "1.0", features = ["derive"] } serde_with = "2.2.0" diff --git a/ferveo-common/src/keypair.rs b/ferveo-common/src/keypair.rs index 70716bfd..485241b3 100644 --- a/ferveo-common/src/keypair.rs +++ b/ferveo-common/src/keypair.rs @@ -6,28 +6,26 @@ use ark_std::{ rand::{prelude::StdRng, RngCore, SeedableRng}, UniformRand, }; -use rand_core::Error; +use generic_array::{typenum::U96, GenericArray}; use serde::*; use serde_with::serde_as; -use crate::serialization; +use crate::{serialization, Error, Result}; // Normally, we would use a custom trait for this, but we can't because // the arkworks will not let us create a blanket implementation for G1Affine // and Fr types. So instead, we're using this shared utility function: -pub fn to_bytes( - item: &T, -) -> Result, ark_serialize::SerializationError> { +pub fn to_bytes(item: &T) -> Result> { let mut writer = Vec::new(); - item.serialize_compressed(&mut writer)?; + item.serialize_compressed(&mut writer) + .map_err(Error::SerializationError)?; Ok(writer) } -pub fn from_bytes( - bytes: &[u8], -) -> Result { +pub fn from_bytes(bytes: &[u8]) -> Result { let mut reader = io::Cursor::new(bytes); - let item = T::deserialize_compressed(&mut reader)?; + let item = T::deserialize_compressed(&mut reader) + .map_err(Error::SerializationError)?; Ok(item) } @@ -39,17 +37,25 @@ pub struct PublicKey { } impl PublicKey { - pub fn to_bytes( - &self, - ) -> Result, ark_serialize::SerializationError> { - to_bytes(&self.encryption_key) + pub fn to_bytes(&self) -> Result> { + let as_bytes = to_bytes(&self.encryption_key)?; + Ok(GenericArray::::from_slice(&as_bytes).to_owned()) } - pub fn from_bytes( - bytes: &[u8], - ) -> Result { - let encryption_key = from_bytes(bytes)?; - Ok(PublicKey:: { encryption_key }) + pub fn from_bytes(bytes: &[u8]) -> Result> { + let bytes = + GenericArray::::from_exact_iter(bytes.iter().cloned()) + .ok_or_else(|| { + Error::InvalidByteLength( + Self::serialized_size(), + bytes.len(), + ) + })?; + from_bytes(&bytes).map(|encryption_key| PublicKey { encryption_key }) + } + + pub fn serialized_size() -> usize { + 96 } } @@ -129,9 +135,9 @@ impl Keypair { 32 } - pub fn from_secure_randomness(bytes: &[u8]) -> Result { + pub fn from_secure_randomness(bytes: &[u8]) -> Result { if bytes.len() != Self::secure_randomness_size() { - return Err(Error::new("Invalid seed length")); + return Err(Error::InvalidSeedLength(bytes.len())); } let mut seed = [0; 32]; seed.copy_from_slice(bytes); diff --git a/ferveo-common/src/lib.rs b/ferveo-common/src/lib.rs index f8420468..c041b6da 100644 --- a/ferveo-common/src/lib.rs +++ b/ferveo-common/src/lib.rs @@ -1,5 +1,36 @@ pub mod keypair; pub mod serialization; +use std::{fmt, fmt::Formatter}; + pub use keypair::*; pub use serialization::*; + +#[derive(Debug)] +pub enum Error { + InvalidByteLength(usize, usize), + SerializationError(ark_serialize::SerializationError), + InvalidSeedLength(usize), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + match self { + Error::InvalidByteLength(expected, actual) => { + write!( + f, + "Invalid byte length: expected {}, actual {}", + expected, actual + ) + } + Error::SerializationError(e) => { + write!(f, "Serialization error: {}", e) + } + Error::InvalidSeedLength(len) => { + write!(f, "Invalid seed length: {}", len) + } + } + } +} + +type Result = std::result::Result; diff --git a/ferveo-python/Cargo.toml b/ferveo-python/Cargo.toml index cb116cf5..7fc78583 100644 --- a/ferveo-python/Cargo.toml +++ b/ferveo-python/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ferveo-python" authors = ["Piotr Roslaniec "] -version = "0.1.0-alpha.0" +version = "0.1.0" edition = "2021" repository = "https://github.com/nucypher/ferveo" publish = false diff --git a/ferveo-python/ferveo/__init__.py b/ferveo-python/ferveo/__init__.py index fbaab504..43b4bbd6 100644 --- a/ferveo-python/ferveo/__init__.py +++ b/ferveo-python/ferveo/__init__.py @@ -15,8 +15,8 @@ DkgPublicKey, SharedSecret, ValidatorMessage, + FerveoVariant, ThresholdEncryptionError, - InvalidShareNumberParameter, InvalidDkgStateToDeal, InvalidDkgStateToAggregate, InvalidDkgStateToVerify, @@ -32,4 +32,5 @@ ValidatorsNotSorted, ValidatorPublicKeyMismatch, SerializationError, + InvalidVariant, ) diff --git a/ferveo-python/ferveo/__init__.pyi b/ferveo-python/ferveo/__init__.pyi index 170e98b0..e16189d1 100644 --- a/ferveo-python/ferveo/__init__.pyi +++ b/ferveo-python/ferveo/__init__.pyi @@ -36,6 +36,9 @@ class FerveoPublicKey: def __hash__(self) -> int: ... + def __richcmp__(self, other: FerveoPublicKey, op: int) -> bool: + ... + class Validator: @@ -170,6 +173,14 @@ class SharedSecret: ... +class FerveoVariant: + @staticmethod + def simple() -> str: ... + + @staticmethod + def precomputed() -> str: ... + + def encrypt(message: bytes, add: bytes, dkg_public_key: DkgPublicKey) -> Ciphertext: ... @@ -198,10 +209,6 @@ class ThresholdEncryptionError(Exception): pass -class InvalidShareNumberParameter(Exception): - pass - - class InvalidDkgStateToDeal(Exception): pass @@ -260,3 +267,7 @@ class ValidatorPublicKeyMismatch(Exception): class SerializationError(Exception): pass + + +class InvalidVariant(Exception): + pass diff --git a/ferveo-python/test/test_serialization.py b/ferveo-python/test/test_serialization.py index 00f800b0..6b564be2 100644 --- a/ferveo-python/test/test_serialization.py +++ b/ferveo-python/test/test_serialization.py @@ -2,7 +2,10 @@ Keypair, Validator, Dkg, - DkgPublicKey + DkgPublicKey, + FerveoPublicKey, + FerveoVariant, + SharedSecret, ) @@ -34,26 +37,49 @@ def make_dkg_public_key(): def make_shared_secret(): - # TODO: implement this + # TODO: Implement this + # SharedSecret.from_bytes(os.urandom(584)) pass +def make_pk(): + return Keypair.random().public_key() + + # def test_shared_secret_serialization(): -# shared_secret = create_shared_secret_instance() +# shared_secret = make_shared_secret() # serialized = bytes(shared_secret) # deserialized = SharedSecret.from_bytes(serialized) -# TODO: Implement comparison -# assert shared_secret == deserialized +# # TODO: Implement __richcmp__ +# # assert shared_secret == deserialized +# assert serialized == bytes(deserialized) def test_keypair_serialization(): keypair = Keypair.random() serialized = bytes(keypair) deserialized = Keypair.from_bytes(serialized) - # TODO: Implement comparison - # assert keypair == deserialized + # TODO: Implement __richcmp__ + # assert serialized == deserialized + assert serialized == bytes(deserialized) def test_dkg_public_key_serialization(): dkg_pk = make_dkg_public_key() serialized = bytes(dkg_pk) + deserialized = DkgPublicKey.from_bytes(serialized) + # TODO: Implement __richcmp__ + assert serialized == bytes(deserialized) assert len(serialized) == DkgPublicKey.serialized_size() + + +def test_public_key_serialization(): + pk = make_pk() + serialized = bytes(pk) + deserialized = FerveoPublicKey.from_bytes(serialized) + assert pk == deserialized + assert len(serialized) == FerveoPublicKey.serialized_size() + + +def test_ferveo_variant_serialization(): + assert FerveoVariant.precomputed() == "FerveoVariant::Precomputed" + assert FerveoVariant.simple() == "FerveoVariant::Simple" diff --git a/ferveo-wasm/Cargo.toml b/ferveo-wasm/Cargo.toml index 320740e2..591c26a7 100644 --- a/ferveo-wasm/Cargo.toml +++ b/ferveo-wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ferveo-wasm" -version = "0.1.0-alpha.1" +version = "0.1.0" authors = ["Piotr Roslaniec "] edition = "2021" license = "GPL-3.0-only" diff --git a/ferveo/CHANGELOG.md b/ferveo/CHANGELOG.md new file mode 100644 index 00000000..5b7af91e --- /dev/null +++ b/ferveo/CHANGELOG.md @@ -0,0 +1,328 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.2.0 (2023-07-07) + + + + + + + + +### New Features + + - expose ferveo variant in bindings + - expose missing method + +### Bug Fixes + + - dkg serialization in wasm bindings + +### Other + + - When announcing an aggregation, the resulting key should also be announced and checked so that it can be included on chain + - Strengthened state guards against aggregation. Necessary for preparing blocks easily + - Fixing up the benchmarks to reflect the refactor in dkg + - Formatting + - Added retry logic to the dkg + - Removed the announce phase from the dkg + +### Chore + + - adjust changelogs for cargo-smart-release + +### New Features (BREAKING) + + - hide dkg public params from bindings + +### Bug Fixes (BREAKING) + + - rename wasm method + +### Commit Statistics + + + + - 261 commits contributed to the release over the course of 652 calendar days. + - 12 commits were understood as [conventional](https://www.conventionalcommits.org). + - 4 unique issues were worked on: [#68](https://github.com/nucypher/ferveo/issues/68), [#70](https://github.com/nucypher/ferveo/issues/70), [#71](https://github.com/nucypher/ferveo/issues/71), [#72](https://github.com/nucypher/ferveo/issues/72) + +### Commit Details + + + +
view details + + * **[#68](https://github.com/nucypher/ferveo/issues/68)** + - Simplify validator sets in dkg state machine ([`73b729a`](https://github.com/nucypher/ferveo/commit/73b729a523b391d40e7a9fe4cbbcdb17557cf089)) + * **[#70](https://github.com/nucypher/ferveo/issues/70)** + - Dkg State Machine refactor ([`8594316`](https://github.com/nucypher/ferveo/commit/85943169e27d7dbbdce835d6563ac4d838a410e1)) + * **[#71](https://github.com/nucypher/ferveo/issues/71)** + - Added serialization/deserialization to the dkg state machine ([`653be13`](https://github.com/nucypher/ferveo/commit/653be13c8a9d7de2e98ac76eca3aadf8f8cadf4a)) + * **[#72](https://github.com/nucypher/ferveo/issues/72)** + - Refactor subproductdomain ([`2d8026b`](https://github.com/nucypher/ferveo/commit/2d8026b2299fd9b67c77fb3b4e565ff9f4e6505b)) + * **Uncategorized** + - Adjust changelogs for cargo-smart-release ([`0eb5bd4`](https://github.com/nucypher/ferveo/commit/0eb5bd48b598709dd0fc54adb424f5f41ce52e92)) + - Adjusting changelogs prior to release of ferveo-common-pre-release v0.1.0, subproductdomain-pre-release v0.1.0, group-threshold-cryptography-pre-release v0.1.0, ferveo-pre-release v0.2.0 ([`0ccba13`](https://github.com/nucypher/ferveo/commit/0ccba13b0608e2023d8792ac9b0402af5ebaad0b)) + - Release 0.1.0 crate versions ([`c02e305`](https://github.com/nucypher/ferveo/commit/c02e3050b7a9dcf0260a5eb4e42ff74f3788c3bf)) + - Release ferveo-common-pre-release@0.1.0-alpha.1 ([`2725ba4`](https://github.com/nucypher/ferveo/commit/2725ba455e2ae169af5be64c5f2261ec0c5ea648)) + - Release ferveo-pre-release@0.1.0-alpha.11 ([`f5f102e`](https://github.com/nucypher/ferveo/commit/f5f102e70e6333b572a0726261095b41ee0c42f6)) + - Merge pull request #134 from piotr-roslaniec/remove-ftt-opt ([`2338213`](https://github.com/nucypher/ferveo/commit/23382139265bc043769d41f4da9e0998f9ba9757)) + - Use general evaluation domain ([`2c20efb`](https://github.com/nucypher/ferveo/commit/2c20efb59d7d1075d6b1413b2ae7fbb55c422143)) + - Fix using bad number of domain points ([`d5ec5e0`](https://github.com/nucypher/ferveo/commit/d5ec5e0f9d1303e51a805c4dafbab7ed2efcb7be)) + - Merge remote-tracking branch 'upstream/pk-static-bytes' into development ([`e24d2cf`](https://github.com/nucypher/ferveo/commit/e24d2cf0067ec6d3770819ed1fd0792342d30605)) + - Merge pull request #137 from nucypher/ferveo-variant ([`802ddba`](https://github.com/nucypher/ferveo/commit/802ddba7a7b1694124395a8941e2ec93f0285ebe)) + - Merge pull request #136 from nucypher/pk-static-bytes ([`2b64c2e`](https://github.com/nucypher/ferveo/commit/2b64c2e8e5e594acffde734b65d212fde3df99e9)) + - Expose ferveo variant in bindings ([`e8d0598`](https://github.com/nucypher/ferveo/commit/e8d05981ee2cc983966c037babeebe5ba0134ffc)) + - Precomputed variant fails for non-power-of-two number of shares ([`8f45430`](https://github.com/nucypher/ferveo/commit/8f45430fb8b6198ae7895d8a598b9d0380f1e568)) + - Remove enforcement on number of shares ([`27c55d0`](https://github.com/nucypher/ferveo/commit/27c55d0c818d5a8e42801612519897844863190d)) + - Replace radix2 eval domain to mixed radix eval domain in ferveo ([`aa78183`](https://github.com/nucypher/ferveo/commit/aa7818320fed7b93d6c2e312e5bd7978da5d4717)) + - Benchmarks evaluation domains ([`9d3cb63`](https://github.com/nucypher/ferveo/commit/9d3cb63c2f50e7b556af5f388f4ca8a969907a08)) + - Update serialization tests where possible ([`3bc28d7`](https://github.com/nucypher/ferveo/commit/3bc28d7756567b4d68b262bf51cdeb53f61836fc)) + - Feat! use static arrays in ferveo public key serialization ([`f9ac1d7`](https://github.com/nucypher/ferveo/commit/f9ac1d70b0fc7df286438fa817537c31cb9e7682)) + - Merge pull request #132 from nucypher/development ([`2057782`](https://github.com/nucypher/ferveo/commit/2057782b0b0bb851e3cdf1fdeabdd60345c7eb36)) + - Release ferveo-pre-release@0.1.0-alpha.10 ([`8dc57d3`](https://github.com/nucypher/ferveo/commit/8dc57d3cf4958825830416574528c30d936bd046)) + - Merge pull request #131 from nucypher/fix-validator-msg-stub ([`0d4e973`](https://github.com/nucypher/ferveo/commit/0d4e973e007b16cff34d649ae107608c809349af)) + - Merge pull request #128 from nucypher/fix-dkg-pk-deser-wasm ([`ad22f46`](https://github.com/nucypher/ferveo/commit/ad22f4665d7d662c4fd723c748ebb0f201ceb9a9)) + - Fix ValidatorMessage stub in python bindings ([`4aeda15`](https://github.com/nucypher/ferveo/commit/4aeda15dd749694416f62fda0504f64bcbe2b444)) + - Expose missing method ([`e516562`](https://github.com/nucypher/ferveo/commit/e51656260f2ec8c607add8a63e6832786915b201)) + - Rename wasm method ([`7388027`](https://github.com/nucypher/ferveo/commit/7388027cb6c77357e8b4d24a891e24a9b4ea2031)) + - Dont hide shared deps behind features ([`3863842`](https://github.com/nucypher/ferveo/commit/38638429fcac9b303bf8a76a526a553c163a6e29)) + - Fix after rebase ([`81564a3`](https://github.com/nucypher/ferveo/commit/81564a3297c996b3fe5a9ed3830dc811d7d766ad)) + - Dkg serialization in wasm bindings ([`99ebfec`](https://github.com/nucypher/ferveo/commit/99ebfecdb7967c4858f918d27ce13cc635c329ac)) + - Merge pull request #127 from piotr-roslaniec/hide-dkg-public-params ([`ccdc209`](https://github.com/nucypher/ferveo/commit/ccdc20990ed3ad6ed8267e5dc54745a3a500b730)) + - Hide dkg public params from bindings ([`8b6e6f5`](https://github.com/nucypher/ferveo/commit/8b6e6f5834d7b736a1d7baf3ddbfa7c60837b9bb)) + - Merge pull request #126 from piotr-roslaniec/derive-equals ([`c259bf7`](https://github.com/nucypher/ferveo/commit/c259bf774939340fca0c2b90d3ee2fb2aa4ad947)) + - Merge pull request #125 from nucypher/naming-conflict ([`658af4b`](https://github.com/nucypher/ferveo/commit/658af4b48abbc6a4d0d03706f7c8986eb90e476d)) + - Merge pull request #125 from nucypher/naming-conflict ([`1dde2f1`](https://github.com/nucypher/ferveo/commit/1dde2f12c6d94d96ecfc024f06b5f89e7810720e)) + - Release ferveo-pre-release@0.1.0-alpha.8 ([`0842e87`](https://github.com/nucypher/ferveo/commit/0842e87cdbcb524e5796be021e96ed3c97a3f73d)) + - Update wasm-bindgen-derive to 0.2.1 ([`4a6a43a`](https://github.com/nucypher/ferveo/commit/4a6a43a043346a969ab0e0ed0c7641a7d6f5b376)) + - Merge pull request #119 from nucypher/nucypher-core-integration ([`52c1f27`](https://github.com/nucypher/ferveo/commit/52c1f27627798fa266d2e5079f5121cc71e8e284)) + - Merge pull request #118 from nucypher/expose-bindings-from-main-crate ([`11d6cea`](https://github.com/nucypher/ferveo/commit/11d6ceaf26f45c76dec0c5a9fcf5eae5301502d3)) + - Merge pull request #114 from piotr-roslaniec/python-exceptions ([`87d8f1c`](https://github.com/nucypher/ferveo/commit/87d8f1cf23e27e01c4a91c964a8327b24e4ad360)) + - Export py module making utility ([`3b02634`](https://github.com/nucypher/ferveo/commit/3b026342ade0ae2d02e210d8b7a72c580cc6e08e)) + - Rename PublicKey to FerveoPublicKey in python bindings ([`10cc1df`](https://github.com/nucypher/ferveo/commit/10cc1df897a81041cfef07b99f28e25de1e76ee8)) + - Expose DkgPublicKey.random in WASM bindings ([`d9edeb7`](https://github.com/nucypher/ferveo/commit/d9edeb7e07332b4e0c5960704206ef14f3c4e55c)) + - Bump wasm-bindgen and wasm-bindgen-derive versions ([`1b33424`](https://github.com/nucypher/ferveo/commit/1b334240c5c32334d4812020ca1b04de4b768a77)) + - Expose DkgPublicKey.random ([`48e54bd`](https://github.com/nucypher/ferveo/commit/48e54bd8d45a545b362fdca28f2a9dd92653f151)) + - Expose encrypt from api ([`fb4df1f`](https://github.com/nucypher/ferveo/commit/fb4df1fd727cf047629e0af37e29c1a8f1d7ed09)) + - Fix wasm locals exceeded ([`ac91e83`](https://github.com/nucypher/ferveo/commit/ac91e8359df44b72e5863da74ac71fe54f8eba81)) + - Update README.md ([`3adf188`](https://github.com/nucypher/ferveo/commit/3adf18857cfdcbd37aea78b7fe3f260ce174a805)) + - Publish 0.1.0-alpha.2 ([`8ce4697`](https://github.com/nucypher/ferveo/commit/8ce469734f08511ee3c897d09aa323a8a1ac62fe)) + - Publish ferveo@0.1.0-alpha.1 ([`1db0123`](https://github.com/nucypher/ferveo/commit/1db0123603a6f793e5f6485a89a7e6f0edbdffb1)) + - Fix import in benchmarks ([`1373b19`](https://github.com/nucypher/ferveo/commit/1373b194830162c1eb22b386bd1b12d7c5253df8)) + - Rename PublicKey to FerveoPublicKey in wasm bindings ([`0f399ef`](https://github.com/nucypher/ferveo/commit/0f399ef9b428889f99b65b57d4968b7afff91383)) + - Release pre-release crates ([`8df87ff`](https://github.com/nucypher/ferveo/commit/8df87ff36ac81bd9e60013cda892d31ddf402868)) + - Apply changes for nucypher-core integration ([`b69949c`](https://github.com/nucypher/ferveo/commit/b69949ca53b24d7f5fc4e71f3a0d7ca8e5d8d034)) + - Fix clippy warning ([`494d061`](https://github.com/nucypher/ferveo/commit/494d06174b4afc1caa706297f02389dd6c5ae63a)) + - Update crates to 2021 edition #111 ([`591c05e`](https://github.com/nucypher/ferveo/commit/591c05e64ef9d2f7218418b6aa9d33181c60c88f)) + - Move utils ([`98c49d1`](https://github.com/nucypher/ferveo/commit/98c49d18cee607395ffb65ad0e1dd8e863d28f94)) + - Move wasm bindings ([`7cfe558`](https://github.com/nucypher/ferveo/commit/7cfe55819ca4ae619c46cb63b0668225591931cd)) + - Move python bindings ([`f6c03f7`](https://github.com/nucypher/ferveo/commit/f6c03f76fbe36a78abbdaf41e69de0c8956f7046)) + - Rename InvalidFinalKey error type to InvalidDkgPublicKey ([`9554a4a`](https://github.com/nucypher/ferveo/commit/9554a4ad83e5e826cf04b4de74eb0a092822685a)) + - Expose typed python exceptions ([`6b6f6d7`](https://github.com/nucypher/ferveo/commit/6b6f6d724eeb11c1b638ce51c94f904dec9f73b1)) + - Merge pull request #107 from piotr-roslaniec/zeroize ([`a7eebe5`](https://github.com/nucypher/ferveo/commit/a7eebe57ecbb1aed57410c54710ad79fa6402601)) + - Apply pr suggestions ([`1a48fea`](https://github.com/nucypher/ferveo/commit/1a48fea1c43e038e5f29f9f0a884666ca8dbe9e2)) + - Merge remote-tracking branch 'upstream/main' into zeroize ([`c9b230a`](https://github.com/nucypher/ferveo/commit/c9b230aa011cc537d7d5dcee84cd63a595b471cc)) + - Zeroize plaintext ([`a7e1914`](https://github.com/nucypher/ferveo/commit/a7e1914a7cb677105ffe58d74e02a04afb5fc8a7)) + - Zeroize on drop ([`b2402e7`](https://github.com/nucypher/ferveo/commit/b2402e7eade318efde104220dcf92c390d45ccca)) + - Remove stray file from a bad merge ([`062e776`](https://github.com/nucypher/ferveo/commit/062e7765a893dfc0989ea180f0f9644063958294)) + - Zeroize shared secret ([`54ce650`](https://github.com/nucypher/ferveo/commit/54ce65076c45f937fa0e29a780206f2e32063a92)) + - Merge pull request #109 from piotr-roslaniec/static-arrays ([`e75e8b8`](https://github.com/nucypher/ferveo/commit/e75e8b86e228b5456a613d1f4ffd03d2540e23b1)) + - Remove unused packages ([`24d8fb4`](https://github.com/nucypher/ferveo/commit/24d8fb451e244e0ad9287e1ae30b72ffeeb5254b)) + - Merge remote-tracking branch 'upstream/main' into static-arrays ([`7f663f3`](https://github.com/nucypher/ferveo/commit/7f663f3e006e7a9657f84c1fdfb02d04bde413da)) + - Merge pull request #113 from piotr-roslaniec/fix-simple-tdec-shares ([`85fe85a`](https://github.com/nucypher/ferveo/commit/85fe85aeface8eba8752c00d029e7a200216e9e3)) + - Remove implicit ordering from domain points in public dkg params ([`6ab1df9`](https://github.com/nucypher/ferveo/commit/6ab1df92d0d55f5c93d8eeae505a2d8146b27811)) + - Ensure dkg pk is serialized to 48 bytes ([`5570c0d`](https://github.com/nucypher/ferveo/commit/5570c0d5bb2ee7a64eac78861c4999d9c98f455a)) + - Zeroize secret polynomial ([`eb033db`](https://github.com/nucypher/ferveo/commit/eb033db8e9a98f813f711a6001440e0ed0cd2dd5)) + - Merge remote-tracking branch 'upstream/main' into release-ferveo-py ([`b2cc5a8`](https://github.com/nucypher/ferveo/commit/b2cc5a81b443d9af182ca453ece8282e0c8341db)) + - Merge pull request #102 from piotr-roslaniec/local-verification-wasm ([`aacdf04`](https://github.com/nucypher/ferveo/commit/aacdf0462d73720e97c1d7924fc49e3d252a691a)) + - Fix pyo3 linking issues at test time ([`cf43433`](https://github.com/nucypher/ferveo/commit/cf43433893750acaf13f69e6f8426fba0c835f84)) + - Self review ([`51cd64f`](https://github.com/nucypher/ferveo/commit/51cd64f71459d56affe03eb7fa9327947e232611)) + - Fix failing test ([`c4912f5`](https://github.com/nucypher/ferveo/commit/c4912f5b11e87a96cb726e9122559ee042ffc15f)) + - Js bindings fail to correctly decrypt the ciphertext ([`ae79060`](https://github.com/nucypher/ferveo/commit/ae790601f691a7727489dbd8606dcd6ed0e4106d)) + - Update js examples ([`9463fb0`](https://github.com/nucypher/ferveo/commit/9463fb0ab7de13b44b2d132ca4005a18c0a76b2f)) + - Update wasm bindings ([`9215238`](https://github.com/nucypher/ferveo/commit/9215238e30987c13cbe66d4c05b118f9ff49d815)) + - Self review ([`c1beeba`](https://github.com/nucypher/ferveo/commit/c1beeba1d30716021400cfc2ec6c985744bca301)) + - Fix failing test ([`ffa71bc`](https://github.com/nucypher/ferveo/commit/ffa71bc19672ace4d6c298cad6d2e0ef58fff74c)) + - Js bindings fail to correctly decrypt the ciphertext ([`3e7db72`](https://github.com/nucypher/ferveo/commit/3e7db72e5878bfc54b0324c4c79a2a058fc9e0e9)) + - Update js examples ([`4a92ed6`](https://github.com/nucypher/ferveo/commit/4a92ed65aaabe055bac4f850f3877bbc3488b139)) + - Update wasm bindings ([`1cc7036`](https://github.com/nucypher/ferveo/commit/1cc7036007c05c231f241047ef01e394b8710205)) + - Merge pull request #93 from piotr-roslaniec/local-verification ([`a6ff917`](https://github.com/nucypher/ferveo/commit/a6ff91794d5a8ddd2b9ffcb7b398f58039017a96)) + - Self review ([`c919c5d`](https://github.com/nucypher/ferveo/commit/c919c5d565d4fb8aee217b2b9a793dd42f091a40)) + - Update python bindings ([`a77fc7a`](https://github.com/nucypher/ferveo/commit/a77fc7ac4aa4e2b5bd9a45faa44e40792fc8b65e)) + - Merge branch 'main' into local-verification ([`dd1eccf`](https://github.com/nucypher/ferveo/commit/dd1eccf1575d98d5bec2486452d3aa435faa02da)) + - Update ferveo api ([`212dcf3`](https://github.com/nucypher/ferveo/commit/212dcf3e37a741667c7c854595e26bd52d36614b)) + - Merge pull request #100 from piotr-roslaniec/expose-dkg-pk-size ([`bd72ef5`](https://github.com/nucypher/ferveo/commit/bd72ef560fc85defbce29e4de9a8d9bc676239f5)) + - Expose size of dkg public key in bindings ([`661780c`](https://github.com/nucypher/ferveo/commit/661780ce1292ed562828b2ad526de4f4b864e6ac)) + - Merge pull request #95 from piotr-roslaniec/implicit-ordering ([`9fded5b`](https://github.com/nucypher/ferveo/commit/9fded5bbd7b85985644844d31cf391dce52aea97)) + - Fix some error-related todos ([`b4117e4`](https://github.com/nucypher/ferveo/commit/b4117e46544eedc7838e278512238872c5426844)) + - Sort validator by their address ([`f6cf412`](https://github.com/nucypher/ferveo/commit/f6cf4125f3d2a767eeb98df1db8bd4b69ccdc222)) + - Refactor for 1.64.0 msrv ([`a23500c`](https://github.com/nucypher/ferveo/commit/a23500ca3918cf9456709340b00e1a54f651bb05)) + - Fix examples ([`2d96a30`](https://github.com/nucypher/ferveo/commit/2d96a30778b44335680c508538dc254114439451)) + - Merge branch 'main' into implicit-ordering ([`3f43524`](https://github.com/nucypher/ferveo/commit/3f43524e0ecdce0578d7b8b4ed7796708a153939)) + - Refactor internal ordering tracking ([`6bb4746`](https://github.com/nucypher/ferveo/commit/6bb4746ab1b2c7b0cd3ae7336fb5d8e5415b1abe)) + - Merge pull request #96 from piotr-roslaniec/bench-ark-sizes ([`1ea3abd`](https://github.com/nucypher/ferveo/commit/1ea3abd4239780e7e674df1af46cc9aa26f57336)) + - Bench arkworks primitives sizes ([`076fd5b`](https://github.com/nucypher/ferveo/commit/076fd5b1a8c9a7fa019e2afdcecc7ad4c676fe85)) + - Fix the ordering and refactor ([`5bb8888`](https://github.com/nucypher/ferveo/commit/5bb8888713d85de68eaffae2f512dfee5ddd2fb7)) + - Establish the correct ordering with sorting ([`0fd1859`](https://github.com/nucypher/ferveo/commit/0fd1859a2d8dc8ece2fdd576d5fa3e5845ffb53a)) + - Add a failing test to reproduce the ordering issue ([`fcb0420`](https://github.com/nucypher/ferveo/commit/fcb042059a976b11d630e2392a85d8c13697314e)) + - Fix after rebase ([`e074f0b`](https://github.com/nucypher/ferveo/commit/e074f0b5bfd3701af01ec04747fdfacad7d64f6d)) + - Expose methods for local verification on client side ([`08e965b`](https://github.com/nucypher/ferveo/commit/08e965bd1b15f35f8edc5d49e72044133b37d85b)) + - Merge pull request #92 from piotr-roslaniec/simple-tdec-py-bindings ([`4b9d8c4`](https://github.com/nucypher/ferveo/commit/4b9d8c4c50f64e5f84b35999557573fcd050f1c9)) + - Refactor bindings to support simple and precomputed tdec variants ([`edc2f26`](https://github.com/nucypher/ferveo/commit/edc2f26269d51d132066c3ff60c94466d4dbe5d8)) + - Merge pull request #75 from nucypher/release-ferveo-py ([`2529f74`](https://github.com/nucypher/ferveo/commit/2529f743fe6f07935938cbef81faa0230e478f87)) + - Fix python-test job on ci ([`9b91b9f`](https://github.com/nucypher/ferveo/commit/9b91b9f9865a2fd478abb4612fa70707e8de02a0)) + - Merge branch 'main' into release-ferveo-py ([`d503b8a`](https://github.com/nucypher/ferveo/commit/d503b8ab657cd6500dbc85cbf6c0d15804be57bc)) + - Replace g_inv with DkgPublicParameters ([`63e9a5f`](https://github.com/nucypher/ferveo/commit/63e9a5fe62ccc39c1f7f88683ce81d011c366342)) + - Merge pull request #91 from nucypher/typed-errors ([`b2eb9ef`](https://github.com/nucypher/ferveo/commit/b2eb9ef48cb977a2db724630ea8c0390d2976da6)) + - Add missing serializatin methods ([`9740da8`](https://github.com/nucypher/ferveo/commit/9740da827cb72145a5b3011f51dfcda5216b712b)) + - Add typed errors and expose them in Python bindings ([`200b4f5`](https://github.com/nucypher/ferveo/commit/200b4f5b4f00be9f939457b3f39a6ccf473d74d8)) + - Merge pull request #56 from nucypher/ferveo-light-tdec ([`8fa25b6`](https://github.com/nucypher/ferveo/commit/8fa25b66bf32585b2ef406bbec3999fd9ce75225)) + - Merge remote-tracking branch 'upstream/main' into ferveo-light-tdec ([`2c5d7c8`](https://github.com/nucypher/ferveo/commit/2c5d7c86af4a70f4694565093c399f5a9296873a)) + - Merge pull request #62 from nucypher/client-server-api ([`3a6e3c4`](https://github.com/nucypher/ferveo/commit/3a6e3c4b59c192289f86c0e37f119b29ccd3d620)) + - Merge pull request #67 from nucypher/arkworks-0.4 ([`bd78f97`](https://github.com/nucypher/ferveo/commit/bd78f9741246a2118bf6e3fdf48c72d6adf51b9e)) + - Merge pull request #72 from piotr-roslaniec/tpke-wasm-api-example ([`a6caaad`](https://github.com/nucypher/ferveo/commit/a6caaad16a10e6a77450f0196f63e5be4ba46f2e)) + - Merge pull request #68 from nucypher/error-handling ([`093f17e`](https://github.com/nucypher/ferveo/commit/093f17e22f606b33a468bd62ad37cf22f3dda265)) + - Merge branch 'error-handling' into tpke-wasm-api-example ([`707f460`](https://github.com/nucypher/ferveo/commit/707f460666acc2781d6dcfa49e0f75f1159f466f)) + - Replace cargo-udeps with cargo-machete ([`9d38a03`](https://github.com/nucypher/ferveo/commit/9d38a03f0f229ff91c5c9d21cc290b30e88ad993)) + - Merge branch 'error-handling' into release-ferveo-py ([`d2a0ca0`](https://github.com/nucypher/ferveo/commit/d2a0ca045beb4dd298f2c06b20b313456a1e81f9)) + - Sketch a pypi package release using maturin ([`3d7ecb4`](https://github.com/nucypher/ferveo/commit/3d7ecb44f9e16f0977c6d91f4264ae5ddef92528)) + - Fix cargo-udeps error ([`8e6f391`](https://github.com/nucypher/ferveo/commit/8e6f3912850ad57e89a21c2d6625e64fcd150fa2)) + - Fix broken build after merge ([`1e78512`](https://github.com/nucypher/ferveo/commit/1e785126d218bec875f5baca28d75233517d4b88)) + - Merge pull request #51 from nucypher/ferveo-pss ([`23955a9`](https://github.com/nucypher/ferveo/commit/23955a9a557b49e425b43e809d9c2555b85e66c5)) + - Sketch error handling in ferveo ([`a68d2d9`](https://github.com/nucypher/ferveo/commit/a68d2d9b62414fd06afa234f240508d1c41e68a8)) + - Fix benchmarks not running on ci ([`af9505d`](https://github.com/nucypher/ferveo/commit/af9505d277eb43760698c5677d2cc0583d6484f4)) + - Refactor serialization ([`b9535fe`](https://github.com/nucypher/ferveo/commit/b9535fefae0795f4b43f726378c5c65d0e776937)) + - Trim external apis ([`0b95048`](https://github.com/nucypher/ferveo/commit/0b9504833ff4025236d9821c5bdc40e66f6774d6)) + - Replace unwrap calls with result type ([`a9b4331`](https://github.com/nucypher/ferveo/commit/a9b4331c3755a0bb0dc0ca5cc355a892dc13d7d3)) + - Self review ([`2d926de`](https://github.com/nucypher/ferveo/commit/2d926de9a96a9492063fe4ad69a4dee51d5cae88)) + - Merge branch 'client-server-api' into arkworks-0.4 ([`ed88c8b`](https://github.com/nucypher/ferveo/commit/ed88c8b9f4bc11b5921ad82274776dc4603fc9c5)) + - Remove unused crate ([`eb9322b`](https://github.com/nucypher/ferveo/commit/eb9322bc3ff49e060b03abf8a915654f3a857f7b)) + - Merge branch 'ferveo-light-tdec' into client-server-api ([`8d5bef8`](https://github.com/nucypher/ferveo/commit/8d5bef892ee8d365e0a6fcc720ae4718a6475cd4)) + - Update arkworks to 0.4.0 - first pass ([`b1999b8`](https://github.com/nucypher/ferveo/commit/b1999b86a2b04c719ec29b1263612de88a0cfd49)) + - Update dev deps settings ([`d588cc8`](https://github.com/nucypher/ferveo/commit/d588cc8d339f8f4fb336fa447dbd914faee80604)) + - Update after rebase ([`aa39d7a`](https://github.com/nucypher/ferveo/commit/aa39d7a0f5e91d2945348cc49f0b5788bcf681af)) + - Merge pull request #54 from theref/TODO ([`6022f00`](https://github.com/nucypher/ferveo/commit/6022f00eaa0a495d0edf7dc92c703a5928824e18)) + - Add simple tdec to wasm bindings ([`1cc35b4`](https://github.com/nucypher/ferveo/commit/1cc35b480ebeb1f0ac6dcfd6c91e5ce627e9929c)) + - Fix import style ([`6d92b01`](https://github.com/nucypher/ferveo/commit/6d92b010139b915da1a89ffa686bf24871c7afd1)) + - Refactor module visibility ([`d287129`](https://github.com/nucypher/ferveo/commit/d287129e0a687edc7dc40ce196461be6617dcbba)) + - Simple tdec on client side fails ([`7257843`](https://github.com/nucypher/ferveo/commit/7257843a9722f4a63bfbe82fcfbaf2088711dfb6)) + - Support server-side persistance ([`81ea692`](https://github.com/nucypher/ferveo/commit/81ea692b10493f81720431750a99392eefba43f3)) + - Merge pull request #48 from nucypher/benchmark-primitives-size ([`58515cf`](https://github.com/nucypher/ferveo/commit/58515cf06c39c578eced7f276d0e7b1b98fd00e9)) + - Merge branch 'ferveo-pss' into ferveo-light-tdec ([`20f0eda`](https://github.com/nucypher/ferveo/commit/20f0edaa20865ef40ce34e99417c35b42b44e1f9)) + - Merge pull request #46 from nucypher/verify-simple-tdec-shares ([`530de97`](https://github.com/nucypher/ferveo/commit/530de97b5008b94b60420adc5735cf1b656b8218)) + - Merge branch 'main' into ferveo-pss ([`1857ef6`](https://github.com/nucypher/ferveo/commit/1857ef6d4249ea2a120ee4264dbfe1745fd25f15)) + - Merge pull request #63 from nucypher/remove-msg ([`9050db0`](https://github.com/nucypher/ferveo/commit/9050db0a2fae2ac9d7f1843813413db8aab0857d)) + - Merge branch 'main' into verify-simple-tdec-shares ([`48a2513`](https://github.com/nucypher/ferveo/commit/48a2513d0e479067fb8e0a5dee574ec3fefb9ce7)) + - Add ferveo-python example ([`fd47f97`](https://github.com/nucypher/ferveo/commit/fd47f97510fad4132712dc58714c19fc0fd0d7e4)) + - Simple tdec on server side ([`39f7f39`](https://github.com/nucypher/ferveo/commit/39f7f39cf618e6c46a809707cfc93bf1aae4e49e)) + - Sketch the server api ([`5ba7451`](https://github.com/nucypher/ferveo/commit/5ba7451f1ae54995e90570b2e970263124ffa803)) + - Remove dependency on block time ([`c85ea43`](https://github.com/nucypher/ferveo/commit/c85ea43d8e2b961aa3871c524c079df04224af4a)) + - Remove unused code ([`735b9c1`](https://github.com/nucypher/ferveo/commit/735b9c1b5244d515238eabbc798eed888267f244)) + - Merge pull request #38 from nucypher/validity-checks ([`168bde6`](https://github.com/nucypher/ferveo/commit/168bde69694089000d8363fba08dd86cc6e101ce)) + - Apply pr suggestions ([`1f76347`](https://github.com/nucypher/ferveo/commit/1f76347c0326424c5776c0e2a99c833d911c9b95)) + - Merge branch 'main' into use-sha256 ([`fa1c1a8`](https://github.com/nucypher/ferveo/commit/fa1c1a8bf2b338cb379a481d8b042c45af23c470)) + - Setup ferveo-python for server api ([`9b0a4c6`](https://github.com/nucypher/ferveo/commit/9b0a4c6a532f477c5e581ad65d9ebc747824fce3)) + - Refactor validator checksums into a struct ([`3366d80`](https://github.com/nucypher/ferveo/commit/3366d8011d960c4e493548011ba9610155d8360d)) + - Integrate light tdec into ferveo crate ([`5eb4fcf`](https://github.com/nucypher/ferveo/commit/5eb4fcfdf6ae19dda06871eb09155f067fb97645)) + - Refactor light tdec ([`20dbfec`](https://github.com/nucypher/ferveo/commit/20dbfec954af517bd9764e81b4bf97abe94ac10d)) + - Remove `window`, `my_partition` and `retry_after` from codebase ([`46d42ab`](https://github.com/nucypher/ferveo/commit/46d42ab0a45e8a0a62d27fd747c7381cf9c4c03a)) + - Merge branch 'verify-simple-tdec-shares' into ferveo-pss ([`3693ba8`](https://github.com/nucypher/ferveo/commit/3693ba85e11ce2dbfc0d6202cb5eef0505b8f753)) + - Merge branch 'validity-checks' into verify-simple-tdec-shares ([`a34b995`](https://github.com/nucypher/ferveo/commit/a34b995d68258b0c956cff87dafa2f968f7ab0ef)) + - Merge branch 'main' into validity-checks ([`dd9e458`](https://github.com/nucypher/ferveo/commit/dd9e4584f9b9715e5c63816234e1c0c0c63df5bc)) + - Size is expressed in bytes ([`6f1b7d4`](https://github.com/nucypher/ferveo/commit/6f1b7d4c7086517f7960a0388acd17baf78504b1)) + - Set polynomial degree to t-1 in pvss ([`6966b28`](https://github.com/nucypher/ferveo/commit/6966b28e3ee273f51c73402ac986a03e10743139)) + - Fix switched columns ([`076f261`](https://github.com/nucypher/ferveo/commit/076f2610c753bb02cd5fe5a2219679f63cdffdea)) + - Benchmark per ratio with no duplicates ([`feb8d80`](https://github.com/nucypher/ferveo/commit/feb8d8077564b43a5dae255b30e842ae75e2e85b)) + - Benchmark size of pvss transcripts ([`6c28d48`](https://github.com/nucypher/ferveo/commit/6c28d48ddc8aa0805b0fdb634564a627baf1f52f)) + - Self review ([`2c9bfec`](https://github.com/nucypher/ferveo/commit/2c9bfec29abf83f7e50fe37b5aceb4908bd40416)) + - Integrate key recovery into ferveo ([`7aa400f`](https://github.com/nucypher/ferveo/commit/7aa400f58a2ca766f36b50a248625aa2d3f2b7f1)) + - Refactor tdec recovery tests in tpke ([`a366089`](https://github.com/nucypher/ferveo/commit/a3660896800cfa35ddab2c07fc1d7dada8f39adb)) + - Integrate key refreshing into ferveo ([`0223a16`](https://github.com/nucypher/ferveo/commit/0223a1623d8f0d4aa0ade9ccf5f33a235cea57cb)) + - Merge pull request #32 from nucypher/simple-decryption-precomputed ([`cd50056`](https://github.com/nucypher/ferveo/commit/cd50056e1f36a7485b7f974e40e4c6584241d151)) + - Refactor key refreshing ([`864dbc2`](https://github.com/nucypher/ferveo/commit/864dbc26cbc6863b7eda7c03ed8e585d0a7159d8)) + - Add pvss verification benchmarks ([`886ca60`](https://github.com/nucypher/ferveo/commit/886ca60e7dbfe02e1af1526f3bccaf6af3e9228c)) + - Implement and benchmark subvariant of simple tdec ([`1bde49d`](https://github.com/nucypher/ferveo/commit/1bde49d8c1920f94cf3d33ca6bb705e667eda22c)) + - Merge branch 'main' into validity-checks ([`208d95c`](https://github.com/nucypher/ferveo/commit/208d95c990084f81eb2e82339e772b0baa8c7748)) + - Merge pull request #27 from nucypher/dkg-pvss-flow ([`e842b8a`](https://github.com/nucypher/ferveo/commit/e842b8a5bb2cafe2e768ca29e5f0210f969ea748)) + - Replace redundant variable ([`6181179`](https://github.com/nucypher/ferveo/commit/618117998ece797319bd5aba765ad51120872d83)) + - Benchmark share verification ([`d499c28`](https://github.com/nucypher/ferveo/commit/d499c2820d8c0cbe959c8092fdefd632da2357af)) + - Refactor decryption share creation ([`64f5023`](https://github.com/nucypher/ferveo/commit/64f5023663ccf6f33b82e87a21b9c89eb7b135ac)) + - Implement simple tdec decryption share verification ([`655e5e3`](https://github.com/nucypher/ferveo/commit/655e5e3a9173d6e38ad176efecd0d380f19578f1)) + - Remove unused variable ([`bacea0a`](https://github.com/nucypher/ferveo/commit/bacea0a2b2e31adcfcdb78bff45b4b69f82c54de)) + - Documents and refactor code ([`6fb4c89`](https://github.com/nucypher/ferveo/commit/6fb4c890cef5c1ca077d301bf4e3e12c78584d39)) + - Fix after rebase ([`dc53f7b`](https://github.com/nucypher/ferveo/commit/dc53f7b568abe296f2f0812b8233e5e388965277)) + - Fix rustfmt ([`0125381`](https://github.com/nucypher/ferveo/commit/0125381809b9ae50e1a40cc167bfe7d2fa710e69)) + - Remove unused code ([`002d407`](https://github.com/nucypher/ferveo/commit/002d407d1f592af1de836af1f5030b9baa423b90)) + - Rename TendermintValidator to ExternalValidator ([`8bd2888`](https://github.com/nucypher/ferveo/commit/8bd2888a95ec91686ce8e62da1533459dc159469)) + - Remove ValidatorSet ([`60e4c6f`](https://github.com/nucypher/ferveo/commit/60e4c6f26c6cc2041ba66cd6697db3bae66ff04e)) + - Cargo fmt ([`6621541`](https://github.com/nucypher/ferveo/commit/66215410afa829639db6417772f7bf443da36d6c)) + - Fix clippy after 1.66 update ([`cafca08`](https://github.com/nucypher/ferveo/commit/cafca08919841dcef7019c6e98e636450d522fa8)) + - Self code review ([`b560ad6`](https://github.com/nucypher/ferveo/commit/b560ad6e5e72a4b1521486cbc90e84fcbff2ed6f)) + - Simple threshold decryption works ([`d3c76cd`](https://github.com/nucypher/ferveo/commit/d3c76cde43f13a9a7c24d24511acbd980b5b6e44)) + - Fix clippy ([`cca3270`](https://github.com/nucypher/ferveo/commit/cca32700b3b13aafab6fcb899f852d3643dddcfd)) + - Simple decryption with one validator works with ferveo dkg ([`4fbaab3`](https://github.com/nucypher/ferveo/commit/4fbaab341e8481d7fbcf103e8b9c29b0a7ea348a)) + - Update aggregation ([`0474b48`](https://github.com/nucypher/ferveo/commit/0474b484a6eb8b9d91eb4b3cb7d56db207eda12c)) + - Updating scheme ([`e2b55b4`](https://github.com/nucypher/ferveo/commit/e2b55b4cd8583d64e02c6b63a936bd6c670dd046)) + - Initial removal of share partitioning ([`ab2857d`](https://github.com/nucypher/ferveo/commit/ab2857d7d30627753ca2ae2a3550284d73d56fec)) + - Incorrect length of decrypted shares after pvss combination ([`efa6150`](https://github.com/nucypher/ferveo/commit/efa6150f3aa07e262290392f41dfa37c83a7a4a4)) + - Wip ([`1b260cc`](https://github.com/nucypher/ferveo/commit/1b260cc97fabf263f88b2f0db1e0ff8cded3928d)) + - Update function docstring ([`da92818`](https://github.com/nucypher/ferveo/commit/da92818fbb7ce06a0b06a3324e975b7f3966f544)) + - Add negative test case for verify_full ([`8e43ae4`](https://github.com/nucypher/ferveo/commit/8e43ae4d39afdab8e9e00d65b3d337bef71b85e6)) + - Documents and refactor code ([`8f7308b`](https://github.com/nucypher/ferveo/commit/8f7308b380483349dc744cc6665b7f7bc9412ded)) + - Fix after rebase ([`26fe690`](https://github.com/nucypher/ferveo/commit/26fe690d14dc29231886f593065d94193a3f913e)) + - Fix rustfmt ([`99d2b9c`](https://github.com/nucypher/ferveo/commit/99d2b9c49b953339ae20a33e5cb9f0e87115b7f3)) + - Remove unused code ([`fb05e62`](https://github.com/nucypher/ferveo/commit/fb05e62fdb784b5b68b80040677a01386eb61141)) + - Rename TendermintValidator to ExternalValidator ([`995fdce`](https://github.com/nucypher/ferveo/commit/995fdcedf42ee3bacdd66689852fcc2f3d5f9794)) + - Remove ValidatorSet ([`4f62c70`](https://github.com/nucypher/ferveo/commit/4f62c704156c9929754bf16a5fd801bf9908ba3f)) + - Cargo fmt ([`1d9f623`](https://github.com/nucypher/ferveo/commit/1d9f623b8bd566871c7888d662264f2b893cdb9f)) + - Fix clippy after 1.66 update ([`44bd186`](https://github.com/nucypher/ferveo/commit/44bd186c365ad62eb47299739928e2490dbe4bee)) + - Self code review ([`89ebffc`](https://github.com/nucypher/ferveo/commit/89ebffc583ee13bc5b19a846fef168663e106bcb)) + - Simple threshold decryption works ([`856790c`](https://github.com/nucypher/ferveo/commit/856790c48d882c87275ddf6d87bbeb1a31ad559b)) + - Fix clippy ([`7cad9ae`](https://github.com/nucypher/ferveo/commit/7cad9aea331ed8e510bca6afd043fe61a466ef08)) + - Simple decryption with one validator works with ferveo dkg ([`57255f5`](https://github.com/nucypher/ferveo/commit/57255f5befb64f3c4cce8d97b2d28db0f0c4f0eb)) + - Update aggregation ([`32f9c49`](https://github.com/nucypher/ferveo/commit/32f9c49e7267a4a1d982dccb023e4f683effeb5a)) + - Updating scheme ([`9759860`](https://github.com/nucypher/ferveo/commit/9759860de694bc35cfb878f5908886283ed83ac7)) + - Initial removal of share partitioning ([`9d38f62`](https://github.com/nucypher/ferveo/commit/9d38f62f5ae7f4a4b25e149e84aad77a02bc4a03)) + - Incorrect length of decrypted shares after pvss combination ([`81d4dd2`](https://github.com/nucypher/ferveo/commit/81d4dd2c67026f2a672c2c421efa38bdfc5f226b)) + - Wip ([`8cb52d8`](https://github.com/nucypher/ferveo/commit/8cb52d8577027414bd1300d40ed9c96669e85f00)) + - Merge pull request #34 from nucypher/benchmarks-pr-compare ([`185822b`](https://github.com/nucypher/ferveo/commit/185822b781ec6febfef28660acbe6fa39dd893a4)) + - Fix benchmarks on ci ([`33cf5c2`](https://github.com/nucypher/ferveo/commit/33cf5c2f7ed7c0971c2f349e38df24047b1ea4f6)) + - Merge pull request #25 from piotr-roslaniec/sd-benchmarks ([`25c745e`](https://github.com/nucypher/ferveo/commit/25c745e3e830fab8161612af6963bc673ce00bb2)) + - Run benchmarks on gh actions ([`ffd67c4`](https://github.com/nucypher/ferveo/commit/ffd67c47238b3dd5d9273ff8e0ba1979d10d4732)) + - Merge pull request #20 from piotr-roslaniec/simple-decryption ([`b2b4809`](https://github.com/nucypher/ferveo/commit/b2b48091092c861ca7a39fcc54573dcd8117db2e)) + - Silence clippy warnings ([`1160971`](https://github.com/nucypher/ferveo/commit/116097195929ffd85e1a979b47d8783cd02285d6)) + - Implement simple threshold decryption variant ([`e7ecab0`](https://github.com/nucypher/ferveo/commit/e7ecab0e1b9b310490e7f7ccf6deb73d08c866b4)) + - Merge pull request #10 from piotr-roslaniec/wasm-bindings ([`f26552d`](https://github.com/nucypher/ferveo/commit/f26552db645e095fb4df6732aa38e1fff1401d72)) + - Merge pull request #17 from nucypher/benchmark-wasm ([`85fba9e`](https://github.com/nucypher/ferveo/commit/85fba9e27de154b8b9701873ab1d370a07283fe3)) + - Panicks at 'capacity overflow' during js-benches ([`9d358e1`](https://github.com/nucypher/ferveo/commit/9d358e16acf3e033e5e5f8bef15a3b05d00d15c6)) + - Fix clippy ([`d80d112`](https://github.com/nucypher/ferveo/commit/d80d11292c35fc2f464c465aecc8803a55f5812b)) + - Expose randomness in dkg setup ([`d8b51ce`](https://github.com/nucypher/ferveo/commit/d8b51cea0b614efb89e2b17c8c23730268a0f65e)) + - Update after rebase ([`b8b2392`](https://github.com/nucypher/ferveo/commit/b8b2392de11068acde07895dc9b6897a742b9b2d)) + - Fix clippy ([`2462c8a`](https://github.com/nucypher/ferveo/commit/2462c8ad5398927047aa35f0b245e1aa29851391)) + - Setup benchmarks ([`1b96071`](https://github.com/nucypher/ferveo/commit/1b960712911e2e02ae2f41e9e773134d8ccdbd96)) + - Add wasm setup ([`ca2e46e`](https://github.com/nucypher/ferveo/commit/ca2e46e67637ce34d531da03124523fb567b7002)) + - Merge pull request #8 from piotr-roslaniec/aad#1 ([`41b5408`](https://github.com/nucypher/ferveo/commit/41b54081c2061126fa8d661207e13aa74406733f)) + - Address pr comments ([`3786af1`](https://github.com/nucypher/ferveo/commit/3786af1e6a8c8ec26c82435f125f6d67c05884cd)) + - Address some clippy warnings ([`e8087d2`](https://github.com/nucypher/ferveo/commit/e8087d23ec6d1845585016259e51cc173160bb92)) + - Replace chacha20 with chacha20poly1305 ([`ce89ead`](https://github.com/nucypher/ferveo/commit/ce89eadb7737e511c743ec01a2fe3bfc9826b32c)) + - Merge pull request #75 from anoma/bat/state-guard-refactor ([`2a35d56`](https://github.com/nucypher/ferveo/commit/2a35d56cacf740bc92478b6be2ebee83a54f4dcc)) + - When announcing an aggregation, the resulting key should also be announced and checked so that it can be included on chain ([`caef6ef`](https://github.com/nucypher/ferveo/commit/caef6ef73dd43a9952d783fcf18abb893b36635f)) + - Strengthened state guards against aggregation. Necessary for preparing blocks easily ([`1594750`](https://github.com/nucypher/ferveo/commit/159475028209948eb40388458a24b0a086afc311)) + - Merge pull request #73 from anoma/bat/announcement-refactor ([`9786ac0`](https://github.com/nucypher/ferveo/commit/9786ac0c9d70f0b73fb2303405db730c98e06440)) + - Fixing up the benchmarks to reflect the refactor in dkg ([`d3fb002`](https://github.com/nucypher/ferveo/commit/d3fb002e52774cd14bff0d1187a2634fad6eea51)) + - Formatting ([`d786fae`](https://github.com/nucypher/ferveo/commit/d786fae33b01cd0863f29b70810dfcc847f2542b)) + - Added retry logic to the dkg ([`09f26b3`](https://github.com/nucypher/ferveo/commit/09f26b39ddc71d9a4b1f226e2dafbdb4c51a7caa)) + - Removed the announce phase from the dkg ([`ec58fe1`](https://github.com/nucypher/ferveo/commit/ec58fe1828d0560525c80cd1dc4013915b0ac54e)) + - Merge pull request #65 from anoma/joe/20210922 ([`d6d603f`](https://github.com/nucypher/ferveo/commit/d6d603fbe82706525a194f42cbab9c3431dd7cc4)) + - Latest ferveo ([`714d8b9`](https://github.com/nucypher/ferveo/commit/714d8b9ea0aaf4ddf1fa910d5c474d80a2985f00)) + - Latest ferveo ([`6c6033c`](https://github.com/nucypher/ferveo/commit/6c6033cdf797c2642462451dd63f2180cc3a2cce)) + - Latest ferveo ([`0f17c3b`](https://github.com/nucypher/ferveo/commit/0f17c3be5cfa55b5f878defcb74ab2b4e13c3190)) +
+ diff --git a/ferveo/Cargo.toml b/ferveo/Cargo.toml index 08a72fdb..371ce228 100644 --- a/ferveo/Cargo.toml +++ b/ferveo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ferveo-pre-release" -version = "0.1.0-alpha.10" +version = "0.2.0" edition = "2021" license = "GPL-3.0" repository = "https://github.com/nucypher/ferveo" @@ -21,8 +21,8 @@ ark-poly = "0.4" ark-serialize = "0.4" ark-std = "0.4" bincode = "1.3" -ferveo-common = { package = "ferveo-common-pre-release", path = "../ferveo-common", version = "0.1.0-alpha.0" } -group-threshold-cryptography = { package = "group-threshold-cryptography-pre-release", path = "../tpke", features = ["api"], version = "0.1.0-alpha.0" } +ferveo-common = { package = "ferveo-common-pre-release", path = "../ferveo-common", version = "^0.1.0" } +group-threshold-cryptography = { package = "group-threshold-cryptography-pre-release", path = "../tpke", features = ["api"], version = "^0.1.0" } hex = "0.4.3" itertools = "0.10.5" measure_time = "0.8" @@ -31,7 +31,7 @@ rand_core = "0.6.4" rand_old = { package = "rand", version = "0.7" } # used by benchmarks/pairing.rs serde = { version = "1.0", features = ["derive"] } serde_with = "2.2.0" -subproductdomain = { package = "subproductdomain-pre-release", path = "../subproductdomain", version = "0.1.0-alpha.0" } +subproductdomain = { package = "subproductdomain-pre-release", path = "../subproductdomain", version = "^0.1.0" } thiserror = "1.0" zeroize = { version = "1.6.0", default-features = false, features = ["derive"] } generic-array = "0.14.7" diff --git a/ferveo/benches/bench_main.rs b/ferveo/benches/bench_main.rs index fbd7c746..81bdb5d9 100644 --- a/ferveo/benches/bench_main.rs +++ b/ferveo/benches/bench_main.rs @@ -7,4 +7,5 @@ criterion_main! { // bench_batch_inverse, // benchmarks::pairing::ec, benchmarks::validity_checks::validity_checks, + benchmarks::eval_domain::eval_domain, } diff --git a/ferveo/benches/benchmarks/eval_domain.rs b/ferveo/benches/benchmarks/eval_domain.rs new file mode 100644 index 00000000..23cd8065 --- /dev/null +++ b/ferveo/benches/benchmarks/eval_domain.rs @@ -0,0 +1,57 @@ +#![allow(clippy::redundant_closure)] +#![allow(clippy::unit_arg)] + +pub use ark_bls12_381::Bls12_381 as EllipticCurve; +use ark_ff::Field; +use ark_poly::EvaluationDomain; +use criterion::{black_box, criterion_group, BenchmarkId, Criterion}; +use digest::crypto_common::rand_core::SeedableRng; +use ferveo_pre_release::*; +use rand::prelude::StdRng; + +const NUM_SHARES_CASES: [usize; 6] = [2, 4, 8, 16, 32, 64]; + +pub fn bench_eval_domain(c: &mut Criterion) { + let mut group = c.benchmark_group("EVAL DOMAIN"); + group.sample_size(10); + + let rng = &mut StdRng::seed_from_u64(0); + let s = ark_bls12_381::Fr::from_random_bytes(&[0u8; 32]).unwrap(); + + for shares_num in NUM_SHARES_CASES { + let eval_radix2_eval_domain = { + let domain = + ark_poly::GeneralEvaluationDomain::new(shares_num).unwrap(); + let phi = SecretPolynomial::::new( + &s, shares_num, rng, + ); + + move || { + black_box(phi.0.evaluate_over_domain_by_ref(domain)); + } + }; + + let eval_mixed_eval_domain = { + let domain = + ark_poly::GeneralEvaluationDomain::new(shares_num).unwrap(); + let phi = SecretPolynomial::::new( + &s, shares_num, rng, + ); + + move || { + black_box(phi.0.evaluate_over_domain_by_ref(domain)); + } + }; + + group.bench_function( + BenchmarkId::new("eval_radix2_eval_domain", shares_num), + |b| b.iter(|| eval_radix2_eval_domain()), + ); + group.bench_function( + BenchmarkId::new("eval_mixed_eval_domain", shares_num), + |b| b.iter(|| eval_mixed_eval_domain()), + ); + } +} + +criterion_group!(eval_domain, bench_eval_domain); diff --git a/ferveo/benches/benchmarks/mod.rs b/ferveo/benches/benchmarks/mod.rs index 0a6bfabe..7e19ab37 100644 --- a/ferveo/benches/benchmarks/mod.rs +++ b/ferveo/benches/benchmarks/mod.rs @@ -1,3 +1,4 @@ //pub mod block_proposer; // pub mod pairing; +pub mod eval_domain; pub mod validity_checks; diff --git a/ferveo/src/api.rs b/ferveo/src/api.rs index 04995dfe..10b283a7 100644 --- a/ferveo/src/api.rs +++ b/ferveo/src/api.rs @@ -1,6 +1,6 @@ -use std::io; +use std::{fmt, io}; -use ark_poly::{EvaluationDomain, Radix2EvaluationDomain}; +use ark_poly::{EvaluationDomain, GeneralEvaluationDomain}; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use ark_std::UniformRand; use bincode; @@ -69,6 +69,38 @@ pub fn decrypt_with_shared_secret( .map_err(Error::from) } +/// The ferveo variant to use for the decryption share derivation. +#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Copy, Clone)] +pub enum FerveoVariant { + /// The simple variant requires m of n shares to decrypt + Simple, + /// The precomputed variant requires n of n shares to decrypt + Precomputed, +} + +impl fmt::Display for FerveoVariant { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.as_str()) + } +} + +impl FerveoVariant { + pub fn as_str(&self) -> &'static str { + match self { + FerveoVariant::Simple => "FerveoVariant::Simple", + FerveoVariant::Precomputed => "FerveoVariant::Precomputed", + } + } + + pub fn from_string(s: &str) -> Result { + match s { + "FerveoVariant::Simple" => Ok(FerveoVariant::Simple), + "FerveoVariant::Precomputed" => Ok(FerveoVariant::Precomputed), + _ => Err(Error::InvalidVariant(s.to_string())), + } + } +} + #[serde_as] #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DkgPublicKey( @@ -84,7 +116,12 @@ impl DkgPublicKey { pub fn from_bytes(bytes: &[u8]) -> Result { let bytes = GenericArray::::from_exact_iter(bytes.iter().cloned()) - .ok_or(Error::InvalidByteLength(48, bytes.len()))?; + .ok_or_else(|| { + Error::InvalidByteLength( + Self::serialized_size(), + bytes.len(), + ) + })?; from_bytes(&bytes).map(DkgPublicKey) } @@ -198,8 +235,8 @@ impl AggregatedTranscript { shares_num: u32, messages: &[ValidatorMessage], ) -> Result { - let pvss_params = crate::pvss::PubliclyVerifiableParams::::default(); - let domain = Radix2EvaluationDomain::::new(shares_num as usize) + let pvss_params = PubliclyVerifiableParams::::default(); + let domain = GeneralEvaluationDomain::::new(shares_num as usize) .expect("Unable to construct an evaluation domain"); let is_valid_optimistic = self.0.verify_optimistic(); @@ -233,7 +270,12 @@ impl AggregatedTranscript { aad: &[u8], validator_keypair: &Keypair, ) -> Result { - let domain_points: Vec<_> = dkg.0.domain.elements().collect(); + let domain_points: Vec<_> = dkg + .0 + .domain + .elements() + .take(dkg.0.dkg_params.shares_num as usize) + .collect(); self.0.make_decryption_share_simple_precomputed( ciphertext, aad, @@ -357,183 +399,205 @@ mod test_ferveo_api { (messages, validators, validator_keypairs) } + #[test] + fn test_dkg_pk_serialization() { + let dkg_pk = DkgPublicKey::random(); + let serialized = dkg_pk.to_bytes().unwrap(); + let deserialized = DkgPublicKey::from_bytes(&serialized).unwrap(); + assert_eq!(dkg_pk, deserialized); + } + #[test] fn test_server_api_tdec_precomputed() { let rng = &mut StdRng::seed_from_u64(0); - let tau = 1; - let shares_num = 4; - // In precomputed variant, the security threshold is equal to the number of shares - // TODO: Refactor DKG constructor to not require security threshold or this case. - // Or figure out a different way to simplify the precomputed variant API. - let security_threshold = shares_num; - - let (messages, validators, validator_keypairs) = - make_test_inputs(rng, tau, security_threshold, shares_num); - - // Now that every validator holds a dkg instance and a transcript for every other validator, - // every validator can aggregate the transcripts - let me = validators[0].clone(); - let mut dkg = - Dkg::new(tau, shares_num, security_threshold, &validators, &me) - .unwrap(); - - let pvss_aggregated = dkg.aggregate_transcripts(&messages).unwrap(); - assert!(pvss_aggregated.verify(shares_num, &messages).unwrap()); - - // At this point, any given validator should be able to provide a DKG public key - let dkg_public_key = dkg.public_key(); - - // In the meantime, the client creates a ciphertext and decryption request - let msg = "my-msg".as_bytes().to_vec(); - let aad: &[u8] = "my-aad".as_bytes(); - let rng = &mut thread_rng(); - let ciphertext = tpke::api::encrypt( - SecretBox::new(msg.clone()), - aad, - &dkg_public_key.0, - rng, - ) - .unwrap(); - - // Having aggregated the transcripts, the validators can now create decryption shares - let decryption_shares: Vec<_> = izip!(&validators, &validator_keypairs) - .map(|(validator, validator_keypair)| { - // Each validator holds their own instance of DKG and creates their own aggregate - let mut dkg = Dkg::new( - tau, - shares_num, - security_threshold, - &validators, - validator, - ) - .unwrap(); - let aggregate = dkg.aggregate_transcripts(&messages).unwrap(); - assert!(pvss_aggregated.verify(shares_num, &messages).unwrap()); - aggregate - .create_decryption_share_precomputed( - &dkg, - &ciphertext, - aad, - validator_keypair, - ) - .unwrap() - }) - .collect(); - - // Now, the decryption share can be used to decrypt the ciphertext - // This part is part of the client API - - let shared_secret = share_combine_precomputed(&decryption_shares); - let plaintext = decrypt_with_shared_secret( - &ciphertext, - aad, - &SharedSecret(shared_secret), - ) - .unwrap(); - assert_eq!(plaintext, msg); - - // Since we're using a precomputed variant, we need all the shares to be able to decrypt - // So if we remove one share, we should not be able to decrypt - let decryption_shares = - decryption_shares[..shares_num as usize - 1].to_vec(); - - let shared_secret = share_combine_precomputed(&decryption_shares); - let result = decrypt_with_shared_secret( - &ciphertext, - aad, - &SharedSecret(shared_secret), - ); - assert!(result.is_err()); + // Works for both power of 2 and non-power of 2 + for shares_num in [4, 7] { + let tau = 1; + // In precomputed variant, the security threshold is equal to the number of shares + // TODO: Refactor DKG constructor to not require security threshold or this case. + // Or figure out a different way to simplify the precomputed variant API. + let security_threshold = shares_num; + + let (messages, validators, validator_keypairs) = + make_test_inputs(rng, tau, security_threshold, shares_num); + + // Now that every validator holds a dkg instance and a transcript for every other validator, + // every validator can aggregate the transcripts + let me = validators[0].clone(); + let mut dkg = + Dkg::new(tau, shares_num, security_threshold, &validators, &me) + .unwrap(); + + let pvss_aggregated = dkg.aggregate_transcripts(&messages).unwrap(); + assert!(pvss_aggregated.verify(shares_num, &messages).unwrap()); + + // At this point, any given validator should be able to provide a DKG public key + let dkg_public_key = dkg.public_key(); + + // In the meantime, the client creates a ciphertext and decryption request + let msg = "my-msg".as_bytes().to_vec(); + let aad: &[u8] = "my-aad".as_bytes(); + let rng = &mut thread_rng(); + let ciphertext = tpke::api::encrypt( + SecretBox::new(msg.clone()), + aad, + &dkg_public_key.0, + rng, + ) + .unwrap(); + + // Having aggregated the transcripts, the validators can now create decryption shares + let decryption_shares: Vec<_> = + izip!(&validators, &validator_keypairs) + .map(|(validator, validator_keypair)| { + // Each validator holds their own instance of DKG and creates their own aggregate + let mut dkg = Dkg::new( + tau, + shares_num, + security_threshold, + &validators, + validator, + ) + .unwrap(); + let aggregate = + dkg.aggregate_transcripts(&messages).unwrap(); + assert!(pvss_aggregated + .verify(shares_num, &messages) + .unwrap()); + + // And then each validator creates their own decryption share + aggregate + .create_decryption_share_precomputed( + &dkg, + &ciphertext, + aad, + validator_keypair, + ) + .unwrap() + }) + .collect(); + + // Now, the decryption share can be used to decrypt the ciphertext + // This part is part of the client API + + let shared_secret = share_combine_precomputed(&decryption_shares); + let plaintext = decrypt_with_shared_secret( + &ciphertext, + aad, + &SharedSecret(shared_secret), + ) + .unwrap(); + assert_eq!(plaintext, msg); + + // Since we're using a precomputed variant, we need all the shares to be able to decrypt + // So if we remove one share, we should not be able to decrypt + let decryption_shares = + decryption_shares[..shares_num as usize - 1].to_vec(); + + let shared_secret = share_combine_precomputed(&decryption_shares); + let result = decrypt_with_shared_secret( + &ciphertext, + aad, + &SharedSecret(shared_secret), + ); + assert!(result.is_err()); + } } #[test] fn test_server_api_tdec_simple() { let rng = &mut StdRng::seed_from_u64(0); - let tau = 1; - let shares_num = 4; - let security_threshold = 3; - - let (messages, validators, validator_keypairs) = - make_test_inputs(rng, tau, security_threshold, shares_num); - - // Now that every validator holds a dkg instance and a transcript for every other validator, - // every validator can aggregate the transcripts - let mut dkg = Dkg::new( - tau, - shares_num, - security_threshold, - &validators, - &validators[0], - ) - .unwrap(); - - let pvss_aggregated = dkg.aggregate_transcripts(&messages).unwrap(); - assert!(pvss_aggregated.verify(shares_num, &messages).unwrap()); - - // At this point, any given validator should be able to provide a DKG public key - let public_key = dkg.public_key(); - - // In the meantime, the client creates a ciphertext and decryption request - let msg = "my-msg".as_bytes().to_vec(); - let aad: &[u8] = "my-aad".as_bytes(); - let rng = &mut thread_rng(); - let ciphertext = tpke::api::encrypt( - SecretBox::new(msg.clone()), - aad, - &public_key.0, - rng, - ) - .unwrap(); - - // Having aggregated the transcripts, the validators can now create decryption shares - let decryption_shares: Vec<_> = izip!(&validators, &validator_keypairs) - .map(|(validator, validator_keypair)| { - // Each validator holds their own instance of DKG and creates their own aggregate - let mut dkg = Dkg::new( - tau, - shares_num, - security_threshold, - &validators, - validator, - ) - .unwrap(); - let aggregate = dkg.aggregate_transcripts(&messages).unwrap(); - assert!(aggregate.verify(shares_num, &messages).unwrap()); - aggregate - .create_decryption_share_simple( - &dkg, - &ciphertext, - aad, - validator_keypair, - ) - .unwrap() - }) - .collect(); - - // Now, the decryption share can be used to decrypt the ciphertext - // This part is part of the client API - - // In simple variant, we only need `security_threshold` shares to be able to decrypt - let decryption_shares = - decryption_shares[..security_threshold as usize].to_vec(); - - let shared_secret = combine_shares_simple(&decryption_shares); - let plaintext = - decrypt_with_shared_secret(&ciphertext, aad, &shared_secret) - .unwrap(); - assert_eq!(plaintext, msg); - - // Let's say that we've only received `security_threshold - 1` shares - // In this case, we should not be able to decrypt - let decryption_shares = - decryption_shares[..security_threshold as usize - 1].to_vec(); - - let shared_secret = combine_shares_simple(&decryption_shares); - let result = - decrypt_with_shared_secret(&ciphertext, aad, &shared_secret); - assert!(result.is_err()); + // Works for both power of 2 and non-power of 2 + for shares_num in [4, 7] { + let tau = 1; + let security_threshold = shares_num / 2 + 1; + + let (messages, validators, validator_keypairs) = + make_test_inputs(rng, tau, security_threshold, shares_num); + + // Now that every validator holds a dkg instance and a transcript for every other validator, + // every validator can aggregate the transcripts + let mut dkg = Dkg::new( + tau, + shares_num, + security_threshold, + &validators, + &validators[0], + ) + .unwrap(); + + let pvss_aggregated = dkg.aggregate_transcripts(&messages).unwrap(); + assert!(pvss_aggregated.verify(shares_num, &messages).unwrap()); + + // At this point, any given validator should be able to provide a DKG public key + let public_key = dkg.public_key(); + + // In the meantime, the client creates a ciphertext and decryption request + let msg = "my-msg".as_bytes().to_vec(); + let aad: &[u8] = "my-aad".as_bytes(); + let rng = &mut thread_rng(); + let ciphertext = tpke::api::encrypt( + SecretBox::new(msg.clone()), + aad, + &public_key.0, + rng, + ) + .unwrap(); + + // Having aggregated the transcripts, the validators can now create decryption shares + let decryption_shares: Vec<_> = + izip!(&validators, &validator_keypairs) + .map(|(validator, validator_keypair)| { + // Each validator holds their own instance of DKG and creates their own aggregate + let mut dkg = Dkg::new( + tau, + shares_num, + security_threshold, + &validators, + validator, + ) + .unwrap(); + let aggregate = + dkg.aggregate_transcripts(&messages).unwrap(); + assert!(aggregate + .verify(shares_num, &messages) + .unwrap()); + aggregate + .create_decryption_share_simple( + &dkg, + &ciphertext, + aad, + validator_keypair, + ) + .unwrap() + }) + .collect(); + + // Now, the decryption share can be used to decrypt the ciphertext + // This part is part of the client API + + // In simple variant, we only need `security_threshold` shares to be able to decrypt + let decryption_shares = + decryption_shares[..security_threshold as usize].to_vec(); + + let shared_secret = combine_shares_simple(&decryption_shares); + let plaintext = + decrypt_with_shared_secret(&ciphertext, aad, &shared_secret) + .unwrap(); + assert_eq!(plaintext, msg); + + // Let's say that we've only received `security_threshold - 1` shares + // In this case, we should not be able to decrypt + let decryption_shares = + decryption_shares[..security_threshold as usize - 1].to_vec(); + + let shared_secret = combine_shares_simple(&decryption_shares); + let result = + decrypt_with_shared_secret(&ciphertext, aad, &shared_secret); + assert!(result.is_err()); + } } #[test] diff --git a/ferveo/src/bindings_python.rs b/ferveo/src/bindings_python.rs index c324e76f..cf19ebc9 100644 --- a/ferveo/src/bindings_python.rs +++ b/ferveo/src/bindings_python.rs @@ -34,9 +34,6 @@ impl From for PyErr { Error::ThresholdEncryptionError(err) => { ThresholdEncryptionError::new_err(err.to_string()) } - Error::InvalidShareNumberParameter(actual) => { - InvalidShareNumberParameter::new_err(actual.to_string()) - } Error::InvalidDkgStateToDeal => { InvalidDkgStateToDeal::new_err("") } @@ -94,6 +91,9 @@ impl From for PyErr { expected, actual )) } + Error::InvalidVariant(variant) => { + InvalidVariant::new_err(variant.to_string()) + } }, _ => default(), } @@ -111,7 +111,6 @@ impl Debug for FerveoPythonError { } create_exception!(exceptions, ThresholdEncryptionError, PyException); -create_exception!(exceptions, InvalidShareNumberParameter, PyValueError); create_exception!(exceptions, InvalidDkgStateToDeal, PyRuntimeError); create_exception!(exceptions, InvalidDkgStateToAggregate, PyRuntimeError); create_exception!(exceptions, InvalidDkgStateToVerify, PyRuntimeError); @@ -128,6 +127,7 @@ create_exception!(exceptions, ValidatorsNotSorted, PyValueError); create_exception!(exceptions, ValidatorPublicKeyMismatch, PyValueError); create_exception!(exceptions, SerializationError, PyValueError); create_exception!(exceptions, InvalidByteLength, PyValueError); +create_exception!(exceptions, InvalidVariant, PyValueError); fn from_py_bytes(bytes: &[u8]) -> PyResult { T::from_bytes(bytes) @@ -172,7 +172,7 @@ where } } -macro_rules! generate_common_methods { +macro_rules! generate_bytes_serialization { ($struct_name:ident) => { #[pymethods] impl $struct_name { @@ -184,17 +184,35 @@ macro_rules! generate_common_methods { fn __bytes__(&self) -> PyResult { to_py_bytes(&self.0) } + } + }; +} - // TODO: Consider implementing this for all structs - Requires PartialOrd and other traits +macro_rules! generate_boxed_bytes_serialization { + ($struct_name:ident, $inner_struct_name:ident) => { + #[pymethods] + impl $struct_name { + #[staticmethod] + pub fn from_bytes(bytes: &[u8]) -> PyResult { + Ok($struct_name( + $inner_struct_name::from_bytes(bytes).map_err(|err| { + FerveoPythonError::Other(err.to_string()) + })?, + )) + } - // fn __richcmp__(&self, other: &Self, op: CompareOp) -> PyResult { - // richcmp(self, other, op) - // } + fn __bytes__(&self) -> PyResult { + let bytes = self + .0 + .to_bytes() + .map_err(|err| FerveoPythonError::Other(err.to_string()))?; + as_py_bytes(&bytes) + } - // fn __hash__(&self) -> PyResult { - // let bytes = self.0.to_bytes()?; - // hash(stringify!($struct_name), &bytes) - // } + #[staticmethod] + pub fn serialized_size() -> usize { + $inner_struct_name::serialized_size() + } } }; } @@ -249,17 +267,33 @@ pub fn decrypt_with_shared_secret( .map_err(|err| FerveoPythonError::FerveoError(err).into()) } +#[pyclass(module = "ferveo")] +struct FerveoVariant {} + +#[pymethods] +impl FerveoVariant { + #[staticmethod] + fn precomputed() -> &'static str { + api::FerveoVariant::Precomputed.as_str() + } + + #[staticmethod] + fn simple() -> &'static str { + api::FerveoVariant::Simple.as_str() + } +} + #[pyclass(module = "ferveo")] #[derive(derive_more::AsRef)] pub struct SharedSecret(api::SharedSecret); -generate_common_methods!(SharedSecret); +generate_bytes_serialization!(SharedSecret); #[pyclass(module = "ferveo")] #[derive(derive_more::From, derive_more::AsRef)] pub struct Keypair(api::Keypair); -generate_common_methods!(Keypair); +generate_bytes_serialization!(Keypair); #[pymethods] impl Keypair { @@ -285,16 +319,19 @@ impl Keypair { } } +type InnerPublicKey = api::PublicKey; + #[pyclass(module = "ferveo")] #[derive( Clone, PartialEq, PartialOrd, Eq, derive_more::From, derive_more::AsRef, )] -pub struct FerveoPublicKey(api::PublicKey); +pub struct FerveoPublicKey(InnerPublicKey); -generate_common_methods!(FerveoPublicKey); +generate_boxed_bytes_serialization!(FerveoPublicKey, InnerPublicKey); #[pymethods] impl FerveoPublicKey { + // We implement `__richcmp__` because FerveoPublicKeys must be sortable in some cases fn __richcmp__(&self, other: &Self, op: CompareOp) -> PyResult { richcmp(self, other, op) } @@ -303,7 +340,7 @@ impl FerveoPublicKey { let bytes = self .0 .to_bytes() - .map_err(|err| FerveoPythonError::FerveoError(err.into()))?; + .map_err(|err| FerveoPythonError::Other(err.to_string()))?; hash("FerveoPublicKey", &bytes) } } @@ -339,33 +376,15 @@ impl Validator { #[derive(Clone, derive_more::From, derive_more::AsRef)] pub struct Transcript(api::Transcript); -generate_common_methods!(Transcript); +generate_bytes_serialization!(Transcript); + +type InnerDkgPublicKey = api::DkgPublicKey; #[pyclass(module = "ferveo")] #[derive(Clone, derive_more::From, derive_more::AsRef)] -pub struct DkgPublicKey(api::DkgPublicKey); +pub struct DkgPublicKey(InnerDkgPublicKey); -#[pymethods] -impl DkgPublicKey { - #[staticmethod] - pub fn from_bytes(bytes: &[u8]) -> PyResult { - Ok(Self( - api::DkgPublicKey::from_bytes(bytes) - .map_err(FerveoPythonError::FerveoError)?, - )) - } - - fn __bytes__(&self) -> PyResult { - let bytes = - self.0.to_bytes().map_err(FerveoPythonError::FerveoError)?; - as_py_bytes(&bytes) - } - - #[staticmethod] - pub fn serialized_size() -> usize { - api::DkgPublicKey::serialized_size() - } -} +generate_boxed_bytes_serialization!(DkgPublicKey, InnerDkgPublicKey); #[pyclass(module = "ferveo")] #[derive(derive_more::From, derive_more::AsRef, Clone)] @@ -462,25 +481,25 @@ impl Dkg { )] pub struct Ciphertext(api::Ciphertext); -generate_common_methods!(Ciphertext); +generate_bytes_serialization!(Ciphertext); #[pyclass(module = "ferveo")] #[derive(Clone, derive_more::AsRef, derive_more::From)] pub struct DecryptionShareSimple(api::DecryptionShareSimple); -generate_common_methods!(DecryptionShareSimple); +generate_bytes_serialization!(DecryptionShareSimple); #[pyclass(module = "ferveo")] #[derive(Clone, derive_more::AsRef, derive_more::From)] pub struct DecryptionSharePrecomputed(api::DecryptionSharePrecomputed); -generate_common_methods!(DecryptionSharePrecomputed); +generate_bytes_serialization!(DecryptionSharePrecomputed); #[pyclass(module = "ferveo")] #[derive(derive_more::From, derive_more::AsRef)] pub struct AggregatedTranscript(api::AggregatedTranscript); -generate_common_methods!(AggregatedTranscript); +generate_bytes_serialization!(AggregatedTranscript); #[pymethods] impl AggregatedTranscript { @@ -587,16 +606,13 @@ pub fn make_ferveo_py_module(py: Python<'_>, m: &PyModule) -> PyResult<()> { m.add_class::()?; m.add_class::()?; m.add_class::()?; + m.add_class::()?; // Exceptions m.add( "ThresholdEncryptionError", py.get_type::(), )?; - m.add( - "InvalidShareNumberParameter", - py.get_type::(), - )?; m.add( "InvalidDkgStateToDeal", py.get_type::(), @@ -642,6 +658,7 @@ pub fn make_ferveo_py_module(py: Python<'_>, m: &PyModule) -> PyResult<()> { py.get_type::(), )?; m.add("SerializationError", py.get_type::())?; + m.add("InvalidVariant", py.get_type::())?; Ok(()) } @@ -844,7 +861,6 @@ mod test_ferveo_python { let shared_secret = combine_decryption_shares_simple(decryption_shares); - // TODO: Fails because of a bad shared secret let plaintext = decrypt_with_shared_secret(&ciphertext, aad, &shared_secret) .unwrap(); diff --git a/ferveo/src/bindings_wasm.rs b/ferveo/src/bindings_wasm.rs index e4b976a3..ab610160 100644 --- a/ferveo/src/bindings_wasm.rs +++ b/ferveo/src/bindings_wasm.rs @@ -99,7 +99,19 @@ fn unwrap_messages_js( Ok(messages) } -macro_rules! generate_common_methods { +macro_rules! generate_equals { + ($struct_name:ident) => { + #[wasm_bindgen] + impl $struct_name { + #[wasm_bindgen] + pub fn equals(&self, other: &$struct_name) -> bool { + self.0 == other.0 + } + } + }; +} + +macro_rules! generate_bytes_serialization { ($struct_name:ident) => { #[wasm_bindgen] impl $struct_name { @@ -112,15 +124,59 @@ macro_rules! generate_common_methods { pub fn to_bytes(&self) -> JsResult> { to_js_bytes(&self.0) } + } + }; +} + +macro_rules! generate_boxed_bytes_serialization { + ($struct_name:ident, $inner_struct_name:ident) => { + #[wasm_bindgen] + impl $struct_name { + #[wasm_bindgen(js_name = "fromBytes")] + pub fn from_bytes(bytes: &[u8]) -> JsResult<$struct_name> { + $inner_struct_name::from_bytes(bytes) + .map_err(map_js_err) + .map(Self) + } - #[wasm_bindgen] - pub fn equals(&self, other: &$struct_name) -> bool { - self.0 == other.0 + #[wasm_bindgen(js_name = "toBytes")] + pub fn to_bytes(&self) -> JsResult> { + let bytes = self.0.to_bytes().map_err(map_js_err)?; + let bytes: Box<[u8]> = bytes.as_slice().into(); + Ok(bytes) + } + + #[wasm_bindgen(js_name = "serializedSize")] + pub fn serialized_size() -> usize { + $inner_struct_name::serialized_size() } } }; } +macro_rules! generate_common_methods { + ($struct_name:ident) => { + generate_equals!($struct_name); + generate_bytes_serialization!($struct_name); + }; +} + +#[wasm_bindgen] +pub struct FerveoVariant {} + +#[wasm_bindgen] +impl FerveoVariant { + #[wasm_bindgen(js_name = "precomputed", getter)] + pub fn precomputed() -> String { + api::FerveoVariant::Precomputed.as_str().to_string() + } + + #[wasm_bindgen(js_name = "simple", getter)] + pub fn simple() -> String { + api::FerveoVariant::Simple.as_str().to_string() + } +} + #[derive(TryFromJsValue)] #[wasm_bindgen] #[derive(Clone, Debug, derive_more::AsRef, derive_more::From)] @@ -135,13 +191,16 @@ pub struct DecryptionSharePrecomputed(tpke::api::DecryptionSharePrecomputed); generate_common_methods!(DecryptionSharePrecomputed); +type InnerPublicKey = api::PublicKey; + #[wasm_bindgen] #[derive( Clone, Debug, derive_more::AsRef, derive_more::From, derive_more::Into, )] -pub struct FerveoPublicKey(api::PublicKey); +pub struct FerveoPublicKey(InnerPublicKey); -generate_common_methods!(FerveoPublicKey); +generate_equals!(FerveoPublicKey); +generate_boxed_bytes_serialization!(FerveoPublicKey, InnerPublicKey); #[wasm_bindgen] #[derive( @@ -212,39 +271,20 @@ pub fn decrypt_with_shared_secret( .map_err(map_js_err) } -#[wasm_bindgen] -pub struct DkgPublicKey(api::DkgPublicKey); +type InnerDkgPublicKey = api::DkgPublicKey; #[wasm_bindgen] -impl DkgPublicKey { - #[wasm_bindgen(js_name = "fromBytes")] - pub fn from_bytes(bytes: &[u8]) -> JsResult { - api::DkgPublicKey::from_bytes(bytes) - .map_err(map_js_err) - .map(Self) - } +pub struct DkgPublicKey(InnerDkgPublicKey); - #[wasm_bindgen(js_name = "toBytes")] - pub fn to_bytes(&self) -> JsResult> { - let bytes = self.0.to_bytes().map_err(map_js_err)?; - let bytes: Box<[u8]> = bytes.as_slice().into(); - Ok(bytes) - } +generate_equals!(DkgPublicKey); +generate_boxed_bytes_serialization!(DkgPublicKey, InnerDkgPublicKey); +#[wasm_bindgen] +impl DkgPublicKey { #[wasm_bindgen] pub fn random() -> DkgPublicKey { Self(api::DkgPublicKey::random()) } - - #[wasm_bindgen(js_name = "serializedSize")] - pub fn serialized_size() -> usize { - api::DkgPublicKey::serialized_size() - } - - #[wasm_bindgen] - pub fn equals(&self, other: &DkgPublicKey) -> bool { - self.0 == other.0 - } } #[wasm_bindgen] diff --git a/ferveo/src/dkg.rs b/ferveo/src/dkg.rs index 0da37084..07dee015 100644 --- a/ferveo/src/dkg.rs +++ b/ferveo/src/dkg.rs @@ -9,10 +9,8 @@ use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_with::serde_as; use crate::{ - aggregate, - utils::{is_power_of_2, is_sorted}, - AggregatedPvss, Error, EthereumAddress, PubliclyVerifiableParams, - PubliclyVerifiableSS, Pvss, Result, Validator, + aggregate, utils::is_sorted, AggregatedPvss, Error, EthereumAddress, + PubliclyVerifiableParams, PubliclyVerifiableSS, Pvss, Result, Validator, }; #[derive(Copy, Clone, Debug, Serialize, Deserialize)] @@ -61,7 +59,7 @@ pub struct PubliclyVerifiableDkg { pub pvss_params: PubliclyVerifiableParams, pub validators: ValidatorsMap, pub vss: PVSSMap, - pub domain: ark_poly::Radix2EvaluationDomain, + pub domain: ark_poly::GeneralEvaluationDomain, pub me: DkgValidator, pub state: DkgState, } @@ -78,13 +76,7 @@ impl PubliclyVerifiableDkg { dkg_params: &DkgParams, me: &Validator, ) -> Result { - // Make sure that the number of shares is a power of 2 for the FFT to work (Radix-2 FFT domain is being used) - if !is_power_of_2(dkg_params.shares_num) { - return Err(Error::InvalidShareNumberParameter( - dkg_params.shares_num, - )); - } - let domain = ark_poly::Radix2EvaluationDomain::::new( + let domain = ark_poly::GeneralEvaluationDomain::::new( dkg_params.shares_num as usize, ) .expect("unable to construct domain"); diff --git a/ferveo/src/lib.rs b/ferveo/src/lib.rs index 7e1b3657..214f9444 100644 --- a/ferveo/src/lib.rs +++ b/ferveo/src/lib.rs @@ -31,10 +31,6 @@ pub enum Error { #[error(transparent)] ThresholdEncryptionError(#[from] tpke::Error), - /// Number of shares parameter must be a power of two - #[error("Number of shares parameter must be a power of two. Got {0}")] - InvalidShareNumberParameter(u32), - /// DKG is not in a valid state to deal PVSS shares #[error("Invalid DKG state to deal PVSS shares")] InvalidDkgStateToDeal, @@ -101,6 +97,9 @@ pub enum Error { #[error("Invalid byte length. Expected {0}, got {1}")] InvalidByteLength(usize, usize), + + #[error("Invalid variant: {0}")] + InvalidVariant(String), } pub type Result = std::result::Result; @@ -170,17 +169,17 @@ mod test_dkg_full { }) .collect(); - let domain = &dkg + let domain_points = &dkg .domain .elements() .take(decryption_shares.len()) .collect::>(); - assert_eq!(domain.len(), decryption_shares.len()); + assert_eq!(domain_points.len(), decryption_shares.len()); // TODO: Consider refactor this part into tpke::combine_simple and expose it // as a public API in tpke::api - let lagrange_coeffs = tpke::prepare_combine_simple::(domain); + let lagrange_coeffs = tpke::prepare_combine_simple::(domain_points); let shared_secret = tpke::share_combine_simple::( &decryption_shares, &lagrange_coeffs, @@ -193,89 +192,103 @@ mod test_dkg_full { fn test_dkg_simple_tdec() { let rng = &mut test_rng(); - let (dkg, validator_keypairs) = setup_dealt_dkg_with_n_validators(3, 4); - let msg = "my-msg".as_bytes().to_vec(); - let aad: &[u8] = "my-aad".as_bytes(); - let public_key = dkg.public_key(); - let ciphertext = tpke::encrypt::( - SecretBox::new(msg.clone()), - aad, - &public_key, - rng, - ) - .unwrap(); + // Works for both power of 2 and non-power of 2 + for shares_num in [4, 7] { + let threshold = shares_num / 2 + 1; + let (dkg, validator_keypairs) = + setup_dealt_dkg_with_n_validators(threshold, shares_num); + let msg = "my-msg".as_bytes().to_vec(); + let aad: &[u8] = "my-aad".as_bytes(); + let public_key = dkg.public_key(); + let ciphertext = tpke::encrypt::( + SecretBox::new(msg.clone()), + aad, + &public_key, + rng, + ) + .unwrap(); - let (_, _, shared_secret) = make_shared_secret_simple_tdec( - &dkg, - aad, - &ciphertext, - &validator_keypairs, - ); + let (_, _, shared_secret) = make_shared_secret_simple_tdec( + &dkg, + aad, + &ciphertext, + &validator_keypairs, + ); - let plaintext = tpke::decrypt_with_shared_secret( - &ciphertext, - aad, - &shared_secret, - &dkg.pvss_params.g_inv(), - ) - .unwrap(); - assert_eq!(plaintext, msg); + let plaintext = tpke::decrypt_with_shared_secret( + &ciphertext, + aad, + &shared_secret, + &dkg.pvss_params.g_inv(), + ) + .unwrap(); + assert_eq!(plaintext, msg); + } } #[test] fn test_dkg_simple_tdec_precomputed() { let rng = &mut test_rng(); - let (dkg, validator_keypairs) = setup_dealt_dkg_with_n_validators(3, 4); - let msg = "my-msg".as_bytes().to_vec(); - let aad: &[u8] = "my-aad".as_bytes(); - let public_key = dkg.public_key(); - let ciphertext = tpke::encrypt::( - SecretBox::new(msg.clone()), - aad, - &public_key, - rng, - ) - .unwrap(); - - let pvss_aggregated = aggregate(&dkg.vss); - pvss_aggregated.verify_aggregation(&dkg).unwrap(); - let domain_points = dkg - .domain - .elements() - .take(validator_keypairs.len()) - .collect::>(); - - let decryption_shares: Vec> = - validator_keypairs - .iter() - .enumerate() - .map(|(validator_address, validator_keypair)| { - pvss_aggregated - .make_decryption_share_simple_precomputed( - &ciphertext, - aad, - &validator_keypair.decryption_key, - validator_address, - &domain_points, - &dkg.pvss_params.g_inv(), - ) - .unwrap() - }) - .collect(); - - let shared_secret = - tpke::share_combine_precomputed::(&decryption_shares); - - // Combination works, let's decrypt - let plaintext = tpke::decrypt_with_shared_secret( - &ciphertext, - aad, - &shared_secret, - &dkg.pvss_params.g_inv(), - ) - .unwrap(); - assert_eq!(plaintext, msg); + // Works for both power of 2 and non-power of 2 + for shares_num in [4, 7] { + // In precomputed variant, threshold must be equal to shares_num + let threshold = shares_num; + let (dkg, validator_keypairs) = + setup_dealt_dkg_with_n_validators(threshold, shares_num); + let msg = "my-msg".as_bytes().to_vec(); + let aad: &[u8] = "my-aad".as_bytes(); + let public_key = dkg.public_key(); + let ciphertext = tpke::encrypt::( + SecretBox::new(msg.clone()), + aad, + &public_key, + rng, + ) + .unwrap(); + + let pvss_aggregated = aggregate(&dkg.vss); + pvss_aggregated.verify_aggregation(&dkg).unwrap(); + let domain_points = dkg + .domain + .elements() + .take(validator_keypairs.len()) + .collect::>(); + + let decryption_shares: Vec> = + validator_keypairs + .iter() + .map(|validator_keypair| { + let validator = dkg + .get_validator(&validator_keypair.public_key()) + .unwrap(); + pvss_aggregated + .make_decryption_share_simple_precomputed( + &ciphertext, + aad, + &validator_keypair.decryption_key, + validator.share_index, + &domain_points, + &dkg.pvss_params.g_inv(), + ) + .unwrap() + }) + .collect(); + assert_eq!(domain_points.len(), decryption_shares.len()); + + let shared_secret = + tpke::share_combine_precomputed::(&decryption_shares); + + // Combination works, let's decrypt + let plaintext = tpke::decrypt_with_shared_secret( + &ciphertext, + aad, + &shared_secret, + &dkg.pvss_params.g_inv(), + ) + .unwrap(); + assert_eq!(plaintext, msg); + } } #[test] diff --git a/ferveo/src/pvss.rs b/ferveo/src/pvss.rs index d79f7c21..0d6433fd 100644 --- a/ferveo/src/pvss.rs +++ b/ferveo/src/pvss.rs @@ -71,7 +71,7 @@ impl Default for PubliclyVerifiableParams { /// Secret polynomial used in the PVSS protocol /// We wrap this in a struct so that we can zeroize it after use -struct SecretPolynomial(DensePolynomial); +pub struct SecretPolynomial(pub DensePolynomial); impl SecretPolynomial { pub fn new( @@ -224,7 +224,7 @@ pub fn do_verify_full( pvss_encrypted_shares: &[E::G2Affine], pvss_params: &PubliclyVerifiableParams, validators: &[Validator], - domain: &ark_poly::Radix2EvaluationDomain, + domain: &ark_poly::GeneralEvaluationDomain, ) -> bool { let mut commitment = batch_to_projective_g1::(pvss_coefficients); domain.fft_in_place(&mut commitment); @@ -256,7 +256,7 @@ pub fn do_verify_aggregation( pvss_agg_encrypted_shares: &[E::G2Affine], pvss_params: &PubliclyVerifiableParams, validators: &[Validator], - domain: &ark_poly::Radix2EvaluationDomain, + domain: &ark_poly::GeneralEvaluationDomain, vss: &PVSSMap, ) -> Result { let is_valid = do_verify_full( @@ -346,6 +346,7 @@ impl PubliclyVerifiableSS { ) .map_err(|e| e.into()) } + pub fn make_decryption_share_simple_precomputed( &self, ciphertext: &Ciphertext, @@ -358,6 +359,7 @@ impl PubliclyVerifiableSS { let private_key_share = self .decrypt_private_key_share(validator_decryption_key, share_index); + // We use the `prepare_combine_simple` function to precompute the lagrange coefficients let lagrange_coeffs = prepare_combine_simple::(domain_points); DecryptionSharePrecomputed::new( diff --git a/ferveo/src/utils.rs b/ferveo/src/utils.rs index 62277430..b8b67b10 100644 --- a/ferveo/src/utils.rs +++ b/ferveo/src/utils.rs @@ -1,7 +1,3 @@ -pub fn is_power_of_2(n: u32) -> bool { - n != 0 && (n & (n - 1)) == 0 -} - pub fn is_sorted(data: I) -> bool where I: IntoIterator, diff --git a/subproductdomain/CHANGELOG.md b/subproductdomain/CHANGELOG.md new file mode 100644 index 00000000..384828fc --- /dev/null +++ b/subproductdomain/CHANGELOG.md @@ -0,0 +1,63 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.1.0 (2023-07-07) + + + +### Chore + + - adjust changelogs for cargo-smart-release + +### Commit Statistics + + + + - 30 commits contributed to the release over the course of 570 calendar days. + - 1 commit was understood as [conventional](https://www.conventionalcommits.org). + - 1 unique issue was worked on: [#72](https://github.com/nucypher/ferveo/issues/72) + +### Commit Details + + + +
view details + + * **[#72](https://github.com/nucypher/ferveo/issues/72)** + - Refactor subproductdomain ([`2d8026b`](https://github.com/nucypher/ferveo/commit/2d8026b2299fd9b67c77fb3b4e565ff9f4e6505b)) + * **Uncategorized** + - Release ferveo-common-pre-release v0.1.0, subproductdomain-pre-release v0.1.0, group-threshold-cryptography-pre-release v0.1.0, ferveo-pre-release v0.2.0 ([`a7b889e`](https://github.com/nucypher/ferveo/commit/a7b889e3a20cfffc96bcb801dfb0946227cb32d9)) + - Adjust changelogs for cargo-smart-release ([`ca43921`](https://github.com/nucypher/ferveo/commit/ca43921af214903e2d1345bb05b5f9c6e1987919)) + - Release 0.1.0 crate versions ([`c02e305`](https://github.com/nucypher/ferveo/commit/c02e3050b7a9dcf0260a5eb4e42ff74f3788c3bf)) + - Merge pull request #134 from piotr-roslaniec/remove-ftt-opt ([`2338213`](https://github.com/nucypher/ferveo/commit/23382139265bc043769d41f4da9e0998f9ba9757)) + - Use general evaluation domain ([`2c20efb`](https://github.com/nucypher/ferveo/commit/2c20efb59d7d1075d6b1413b2ae7fbb55c422143)) + - Fix using bad number of domain points ([`d5ec5e0`](https://github.com/nucypher/ferveo/commit/d5ec5e0f9d1303e51a805c4dafbab7ed2efcb7be)) + - Merge pull request #119 from nucypher/nucypher-core-integration ([`52c1f27`](https://github.com/nucypher/ferveo/commit/52c1f27627798fa266d2e5079f5121cc71e8e284)) + - Merge pull request #118 from nucypher/expose-bindings-from-main-crate ([`11d6cea`](https://github.com/nucypher/ferveo/commit/11d6ceaf26f45c76dec0c5a9fcf5eae5301502d3)) + - Release pre-release crates ([`8df87ff`](https://github.com/nucypher/ferveo/commit/8df87ff36ac81bd9e60013cda892d31ddf402868)) + - Update crates to 2021 edition #111 ([`591c05e`](https://github.com/nucypher/ferveo/commit/591c05e64ef9d2f7218418b6aa9d33181c60c88f)) + - Merge pull request #102 from piotr-roslaniec/local-verification-wasm ([`aacdf04`](https://github.com/nucypher/ferveo/commit/aacdf0462d73720e97c1d7924fc49e3d252a691a)) + - Js bindings fail to correctly decrypt the ciphertext ([`ae79060`](https://github.com/nucypher/ferveo/commit/ae790601f691a7727489dbd8606dcd6ed0e4106d)) + - Js bindings fail to correctly decrypt the ciphertext ([`3e7db72`](https://github.com/nucypher/ferveo/commit/3e7db72e5878bfc54b0324c4c79a2a058fc9e0e9)) + - Merge pull request #75 from nucypher/release-ferveo-py ([`2529f74`](https://github.com/nucypher/ferveo/commit/2529f743fe6f07935938cbef81faa0230e478f87)) + - Merge pull request #56 from nucypher/ferveo-light-tdec ([`8fa25b6`](https://github.com/nucypher/ferveo/commit/8fa25b66bf32585b2ef406bbec3999fd9ce75225)) + - Merge pull request #62 from nucypher/client-server-api ([`3a6e3c4`](https://github.com/nucypher/ferveo/commit/3a6e3c4b59c192289f86c0e37f119b29ccd3d620)) + - Merge pull request #67 from nucypher/arkworks-0.4 ([`bd78f97`](https://github.com/nucypher/ferveo/commit/bd78f9741246a2118bf6e3fdf48c72d6adf51b9e)) + - Merge pull request #68 from nucypher/error-handling ([`093f17e`](https://github.com/nucypher/ferveo/commit/093f17e22f606b33a468bd62ad37cf22f3dda265)) + - Merge branch 'error-handling' into tpke-wasm-api-example ([`707f460`](https://github.com/nucypher/ferveo/commit/707f460666acc2781d6dcfa49e0f75f1159f466f)) + - Replace cargo-udeps with cargo-machete ([`9d38a03`](https://github.com/nucypher/ferveo/commit/9d38a03f0f229ff91c5c9d21cc290b30e88ad993)) + - Merge branch 'error-handling' into release-ferveo-py ([`d2a0ca0`](https://github.com/nucypher/ferveo/commit/d2a0ca045beb4dd298f2c06b20b313456a1e81f9)) + - Sketch error handling in ferveo ([`a68d2d9`](https://github.com/nucypher/ferveo/commit/a68d2d9b62414fd06afa234f240508d1c41e68a8)) + - Self review ([`2d926de`](https://github.com/nucypher/ferveo/commit/2d926de9a96a9492063fe4ad69a4dee51d5cae88)) + - Update arkworks to 0.4.0 - first pass ([`b1999b8`](https://github.com/nucypher/ferveo/commit/b1999b86a2b04c719ec29b1263612de88a0cfd49)) + - Fix import style ([`6d92b01`](https://github.com/nucypher/ferveo/commit/6d92b010139b915da1a89ffa686bf24871c7afd1)) + - Merge branch 'main' into use-sha256 ([`fa1c1a8`](https://github.com/nucypher/ferveo/commit/fa1c1a8bf2b338cb379a481d8b042c45af23c470)) + - Merge pull request #27 from nucypher/dkg-pvss-flow ([`e842b8a`](https://github.com/nucypher/ferveo/commit/e842b8a5bb2cafe2e768ca29e5f0210f969ea748)) + - Fix clippy ([`cca3270`](https://github.com/nucypher/ferveo/commit/cca32700b3b13aafab6fcb899f852d3643dddcfd)) + - Fix clippy ([`7cad9ae`](https://github.com/nucypher/ferveo/commit/7cad9aea331ed8e510bca6afd043fe61a466ef08)) +
+ diff --git a/subproductdomain/Cargo.toml b/subproductdomain/Cargo.toml index 29102555..481b708a 100644 --- a/subproductdomain/Cargo.toml +++ b/subproductdomain/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subproductdomain-pre-release" -version = "0.1.0-alpha.0" +version = "0.1.0" edition = "2021" license = "GPL-3.0" authors = ["Heliax AG ", "Piotr Roslaniec "] diff --git a/subproductdomain/src/lib.rs b/subproductdomain/src/lib.rs index 63dd11cf..4fa52900 100644 --- a/subproductdomain/src/lib.rs +++ b/subproductdomain/src/lib.rs @@ -9,7 +9,7 @@ use ark_ec::{ use ark_ff::{FftField, Field, Zero}; use ark_poly::{ univariate::DensePolynomial, DenseUVPolynomial, EvaluationDomain, - Polynomial, Radix2EvaluationDomain, + GeneralEvaluationDomain, Polynomial, }; /// Compute a fast multiexp of many scalars times the same base @@ -342,7 +342,7 @@ pub fn toeplitz_mul( let m = polynomial.coeffs.len() - 1; let size = ark_std::cmp::max(size, m); - let domain = Radix2EvaluationDomain::::new(2 * size) + let domain = GeneralEvaluationDomain::::new(2 * size) .ok_or_else(|| { anyhow::anyhow!("toeplitz multiplication on too large a domain") })?; diff --git a/tpke/CHANGELOG.md b/tpke/CHANGELOG.md new file mode 100644 index 00000000..8c59003f --- /dev/null +++ b/tpke/CHANGELOG.md @@ -0,0 +1,284 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.1.0 (2023-07-07) + + + +### Chore + + - adjust changelogs for cargo-smart-release + +### Commit Statistics + + + + - 249 commits contributed to the release over the course of 702 calendar days. + - 1 commit was understood as [conventional](https://www.conventionalcommits.org). + - 3 unique issues were worked on: [#70](https://github.com/nucypher/ferveo/issues/70), [#71](https://github.com/nucypher/ferveo/issues/71), [#72](https://github.com/nucypher/ferveo/issues/72) + +### Commit Details + + + +
view details + + * **[#70](https://github.com/nucypher/ferveo/issues/70)** + - Dkg State Machine refactor ([`8594316`](https://github.com/nucypher/ferveo/commit/85943169e27d7dbbdce835d6563ac4d838a410e1)) + * **[#71](https://github.com/nucypher/ferveo/issues/71)** + - Added serialization/deserialization to the dkg state machine ([`653be13`](https://github.com/nucypher/ferveo/commit/653be13c8a9d7de2e98ac76eca3aadf8f8cadf4a)) + * **[#72](https://github.com/nucypher/ferveo/issues/72)** + - Refactor subproductdomain ([`2d8026b`](https://github.com/nucypher/ferveo/commit/2d8026b2299fd9b67c77fb3b4e565ff9f4e6505b)) + * **Uncategorized** + - Release ferveo-common-pre-release v0.1.0, subproductdomain-pre-release v0.1.0, group-threshold-cryptography-pre-release v0.1.0, ferveo-pre-release v0.2.0 ([`a7b889e`](https://github.com/nucypher/ferveo/commit/a7b889e3a20cfffc96bcb801dfb0946227cb32d9)) + - Adjust changelogs for cargo-smart-release ([`ca43921`](https://github.com/nucypher/ferveo/commit/ca43921af214903e2d1345bb05b5f9c6e1987919)) + - Adjusting changelogs prior to release of ferveo-common-pre-release v0.1.0, subproductdomain-pre-release v0.1.0, group-threshold-cryptography-pre-release v0.1.0, ferveo-pre-release v0.2.0 ([`0ccba13`](https://github.com/nucypher/ferveo/commit/0ccba13b0608e2023d8792ac9b0402af5ebaad0b)) + - Release 0.1.0 crate versions ([`c02e305`](https://github.com/nucypher/ferveo/commit/c02e3050b7a9dcf0260a5eb4e42ff74f3788c3bf)) + - Merge pull request #134 from piotr-roslaniec/remove-ftt-opt ([`2338213`](https://github.com/nucypher/ferveo/commit/23382139265bc043769d41f4da9e0998f9ba9757)) + - Use general evaluation domain ([`2c20efb`](https://github.com/nucypher/ferveo/commit/2c20efb59d7d1075d6b1413b2ae7fbb55c422143)) + - Fix using bad number of domain points ([`d5ec5e0`](https://github.com/nucypher/ferveo/commit/d5ec5e0f9d1303e51a805c4dafbab7ed2efcb7be)) + - Merge pull request #119 from nucypher/nucypher-core-integration ([`52c1f27`](https://github.com/nucypher/ferveo/commit/52c1f27627798fa266d2e5079f5121cc71e8e284)) + - Merge pull request #118 from nucypher/expose-bindings-from-main-crate ([`11d6cea`](https://github.com/nucypher/ferveo/commit/11d6ceaf26f45c76dec0c5a9fcf5eae5301502d3)) + - Merge pull request #114 from piotr-roslaniec/python-exceptions ([`87d8f1c`](https://github.com/nucypher/ferveo/commit/87d8f1cf23e27e01c4a91c964a8327b24e4ad360)) + - Publish 0.1.0-alpha.2 ([`8ce4697`](https://github.com/nucypher/ferveo/commit/8ce469734f08511ee3c897d09aa323a8a1ac62fe)) + - Release pre-release crates ([`8df87ff`](https://github.com/nucypher/ferveo/commit/8df87ff36ac81bd9e60013cda892d31ddf402868)) + - Update crates to 2021 edition #111 ([`591c05e`](https://github.com/nucypher/ferveo/commit/591c05e64ef9d2f7218418b6aa9d33181c60c88f)) + - Expose typed python exceptions ([`6b6f6d7`](https://github.com/nucypher/ferveo/commit/6b6f6d724eeb11c1b638ce51c94f904dec9f73b1)) + - Merge pull request #107 from piotr-roslaniec/zeroize ([`a7eebe5`](https://github.com/nucypher/ferveo/commit/a7eebe57ecbb1aed57410c54710ad79fa6402601)) + - Apply pr suggestions ([`1a48fea`](https://github.com/nucypher/ferveo/commit/1a48fea1c43e038e5f29f9f0a884666ca8dbe9e2)) + - Merge remote-tracking branch 'upstream/main' into zeroize ([`c9b230a`](https://github.com/nucypher/ferveo/commit/c9b230aa011cc537d7d5dcee84cd63a595b471cc)) + - Zeroize nonce ([`03974b2`](https://github.com/nucypher/ferveo/commit/03974b2f5d3bb195ced9b9072fbf5703e976962e)) + - Zeroize plaintext ([`a7e1914`](https://github.com/nucypher/ferveo/commit/a7e1914a7cb677105ffe58d74e02a04afb5fc8a7)) + - Zeroize private key share ([`61068f0`](https://github.com/nucypher/ferveo/commit/61068f04f777a81ec5d2662e8a4ebd34ced2094e)) + - Zeroize chacha ([`61c84da`](https://github.com/nucypher/ferveo/commit/61c84da62144c46fd850989f5c9ec17a3ef6ac07)) + - Zeroize on drop ([`b2402e7`](https://github.com/nucypher/ferveo/commit/b2402e7eade318efde104220dcf92c390d45ccca)) + - Zeroize shared secret ([`54ce650`](https://github.com/nucypher/ferveo/commit/54ce65076c45f937fa0e29a780206f2e32063a92)) + - Merge remote-tracking branch 'upstream/main' into static-arrays ([`7f663f3`](https://github.com/nucypher/ferveo/commit/7f663f3e006e7a9657f84c1fdfb02d04bde413da)) + - Merge pull request #113 from piotr-roslaniec/fix-simple-tdec-shares ([`85fe85a`](https://github.com/nucypher/ferveo/commit/85fe85aeface8eba8752c00d029e7a200216e9e3)) + - Remove implicit ordering from domain points in public dkg params ([`6ab1df9`](https://github.com/nucypher/ferveo/commit/6ab1df92d0d55f5c93d8eeae505a2d8146b27811)) + - Merge pull request #102 from piotr-roslaniec/local-verification-wasm ([`aacdf04`](https://github.com/nucypher/ferveo/commit/aacdf0462d73720e97c1d7924fc49e3d252a691a)) + - Fix failing test ([`c4912f5`](https://github.com/nucypher/ferveo/commit/c4912f5b11e87a96cb726e9122559ee042ffc15f)) + - Js bindings fail to correctly decrypt the ciphertext ([`ae79060`](https://github.com/nucypher/ferveo/commit/ae790601f691a7727489dbd8606dcd6ed0e4106d)) + - Fix ci checks ([`f22fb4a`](https://github.com/nucypher/ferveo/commit/f22fb4a56e0b4e54a0f1b7c8d7f4e2bf14cd2d18)) + - Update wasm bindings ([`9215238`](https://github.com/nucypher/ferveo/commit/9215238e30987c13cbe66d4c05b118f9ff49d815)) + - Fix failing test ([`ffa71bc`](https://github.com/nucypher/ferveo/commit/ffa71bc19672ace4d6c298cad6d2e0ef58fff74c)) + - Js bindings fail to correctly decrypt the ciphertext ([`3e7db72`](https://github.com/nucypher/ferveo/commit/3e7db72e5878bfc54b0324c4c79a2a058fc9e0e9)) + - Fix ci checks ([`50a853b`](https://github.com/nucypher/ferveo/commit/50a853b9d755c77817b6eefcf1f6d0c1af601184)) + - Update wasm bindings ([`1cc7036`](https://github.com/nucypher/ferveo/commit/1cc7036007c05c231f241047ef01e394b8710205)) + - Merge pull request #93 from piotr-roslaniec/local-verification ([`a6ff917`](https://github.com/nucypher/ferveo/commit/a6ff91794d5a8ddd2b9ffcb7b398f58039017a96)) + - Update python bindings ([`a77fc7a`](https://github.com/nucypher/ferveo/commit/a77fc7ac4aa4e2b5bd9a45faa44e40792fc8b65e)) + - Merge branch 'main' into local-verification ([`dd1eccf`](https://github.com/nucypher/ferveo/commit/dd1eccf1575d98d5bec2486452d3aa435faa02da)) + - Merge pull request #95 from piotr-roslaniec/implicit-ordering ([`9fded5b`](https://github.com/nucypher/ferveo/commit/9fded5bbd7b85985644844d31cf391dce52aea97)) + - Refactor for 1.64.0 msrv ([`a23500c`](https://github.com/nucypher/ferveo/commit/a23500ca3918cf9456709340b00e1a54f651bb05)) + - Refactor internal ordering tracking ([`6bb4746`](https://github.com/nucypher/ferveo/commit/6bb4746ab1b2c7b0cd3ae7336fb5d8e5415b1abe)) + - Merge pull request #92 from piotr-roslaniec/simple-tdec-py-bindings ([`4b9d8c4`](https://github.com/nucypher/ferveo/commit/4b9d8c4c50f64e5f84b35999557573fcd050f1c9)) + - Refactor bindings to support simple and precomputed tdec variants ([`edc2f26`](https://github.com/nucypher/ferveo/commit/edc2f26269d51d132066c3ff60c94466d4dbe5d8)) + - Merge pull request #75 from nucypher/release-ferveo-py ([`2529f74`](https://github.com/nucypher/ferveo/commit/2529f743fe6f07935938cbef81faa0230e478f87)) + - Merge branch 'main' into release-ferveo-py ([`d503b8a`](https://github.com/nucypher/ferveo/commit/d503b8ab657cd6500dbc85cbf6c0d15804be57bc)) + - Fix ci ([`0ca00c9`](https://github.com/nucypher/ferveo/commit/0ca00c998239e0cb641fea4ccdd085b4122c72a1)) + - Merge pull request #91 from nucypher/typed-errors ([`b2eb9ef`](https://github.com/nucypher/ferveo/commit/b2eb9ef48cb977a2db724630ea8c0390d2976da6)) + - Add missing serializatin methods ([`9740da8`](https://github.com/nucypher/ferveo/commit/9740da827cb72145a5b3011f51dfcda5216b712b)) + - Merge pull request #56 from nucypher/ferveo-light-tdec ([`8fa25b6`](https://github.com/nucypher/ferveo/commit/8fa25b66bf32585b2ef406bbec3999fd9ce75225)) + - Merge remote-tracking branch 'upstream/main' into ferveo-light-tdec ([`2c5d7c8`](https://github.com/nucypher/ferveo/commit/2c5d7c86af4a70f4694565093c399f5a9296873a)) + - Merge pull request #62 from nucypher/client-server-api ([`3a6e3c4`](https://github.com/nucypher/ferveo/commit/3a6e3c4b59c192289f86c0e37f119b29ccd3d620)) + - Merge pull request #67 from nucypher/arkworks-0.4 ([`bd78f97`](https://github.com/nucypher/ferveo/commit/bd78f9741246a2118bf6e3fdf48c72d6adf51b9e)) + - Merge pull request #72 from piotr-roslaniec/tpke-wasm-api-example ([`a6caaad`](https://github.com/nucypher/ferveo/commit/a6caaad16a10e6a77450f0196f63e5be4ba46f2e)) + - Merge pull request #68 from nucypher/error-handling ([`093f17e`](https://github.com/nucypher/ferveo/commit/093f17e22f606b33a468bd62ad37cf22f3dda265)) + - Merge branch 'error-handling' into tpke-wasm-api-example ([`707f460`](https://github.com/nucypher/ferveo/commit/707f460666acc2781d6dcfa49e0f75f1159f466f)) + - Replace cargo-udeps with cargo-machete ([`9d38a03`](https://github.com/nucypher/ferveo/commit/9d38a03f0f229ff91c5c9d21cc290b30e88ad993)) + - Merge branch 'error-handling' into release-ferveo-py ([`d2a0ca0`](https://github.com/nucypher/ferveo/commit/d2a0ca045beb4dd298f2c06b20b313456a1e81f9)) + - Merge pull request #51 from nucypher/ferveo-pss ([`23955a9`](https://github.com/nucypher/ferveo/commit/23955a9a557b49e425b43e809d9c2555b85e66c5)) + - Sketch error handling in ferveo ([`a68d2d9`](https://github.com/nucypher/ferveo/commit/a68d2d9b62414fd06afa234f240508d1c41e68a8)) + - Fix benchmarks not running on ci ([`af9505d`](https://github.com/nucypher/ferveo/commit/af9505d277eb43760698c5677d2cc0583d6484f4)) + - Refactor serialization ([`b9535fe`](https://github.com/nucypher/ferveo/commit/b9535fefae0795f4b43f726378c5c65d0e776937)) + - Trim external apis ([`0b95048`](https://github.com/nucypher/ferveo/commit/0b9504833ff4025236d9821c5bdc40e66f6774d6)) + - Replace unwrap calls with result type ([`a9b4331`](https://github.com/nucypher/ferveo/commit/a9b4331c3755a0bb0dc0ca5cc355a892dc13d7d3)) + - Self review ([`2d926de`](https://github.com/nucypher/ferveo/commit/2d926de9a96a9492063fe4ad69a4dee51d5cae88)) + - Merge branch 'client-server-api' into arkworks-0.4 ([`ed88c8b`](https://github.com/nucypher/ferveo/commit/ed88c8b9f4bc11b5921ad82274776dc4603fc9c5)) + - Replace unmaintained rust-crypto crate with sha2 ([`3040970`](https://github.com/nucypher/ferveo/commit/3040970d1d61cbb13a7577422a5422eca445deca)) + - Merge branch 'ferveo-light-tdec' into client-server-api ([`8d5bef8`](https://github.com/nucypher/ferveo/commit/8d5bef892ee8d365e0a6fcc720ae4718a6475cd4)) + - Update arkworks to 0.4.0 - first pass ([`b1999b8`](https://github.com/nucypher/ferveo/commit/b1999b86a2b04c719ec29b1263612de88a0cfd49)) + - Update dev deps settings ([`d588cc8`](https://github.com/nucypher/ferveo/commit/d588cc8d339f8f4fb336fa447dbd914faee80604)) + - Update after rebase ([`aa39d7a`](https://github.com/nucypher/ferveo/commit/aa39d7a0f5e91d2945348cc49f0b5788bcf681af)) + - Merge pull request #54 from theref/TODO ([`6022f00`](https://github.com/nucypher/ferveo/commit/6022f00eaa0a495d0edf7dc92c703a5928824e18)) + - Add simple tdec to wasm bindings ([`1cc35b4`](https://github.com/nucypher/ferveo/commit/1cc35b480ebeb1f0ac6dcfd6c91e5ce627e9929c)) + - Fix import style ([`6d92b01`](https://github.com/nucypher/ferveo/commit/6d92b010139b915da1a89ffa686bf24871c7afd1)) + - Update client api tests ([`2e6b231`](https://github.com/nucypher/ferveo/commit/2e6b2317c44a0445db85fc9a1c58a71bb85e5c14)) + - Refactor module visibility ([`d287129`](https://github.com/nucypher/ferveo/commit/d287129e0a687edc7dc40ce196461be6617dcbba)) + - Simple tdec on client side fails ([`7257843`](https://github.com/nucypher/ferveo/commit/7257843a9722f4a63bfbe82fcfbaf2088711dfb6)) + - Merge pull request #48 from nucypher/benchmark-primitives-size ([`58515cf`](https://github.com/nucypher/ferveo/commit/58515cf06c39c578eced7f276d0e7b1b98fd00e9)) + - Merge branch 'ferveo-pss' into ferveo-light-tdec ([`20f0eda`](https://github.com/nucypher/ferveo/commit/20f0edaa20865ef40ce34e99417c35b42b44e1f9)) + - Merge pull request #46 from nucypher/verify-simple-tdec-shares ([`530de97`](https://github.com/nucypher/ferveo/commit/530de97b5008b94b60420adc5735cf1b656b8218)) + - Merge branch 'main' into ferveo-pss ([`1857ef6`](https://github.com/nucypher/ferveo/commit/1857ef6d4249ea2a120ee4264dbfe1745fd25f15)) + - Merge branch 'main' into verify-simple-tdec-shares ([`48a2513`](https://github.com/nucypher/ferveo/commit/48a2513d0e479067fb8e0a5dee574ec3fefb9ce7)) + - Add ferveo-python example ([`fd47f97`](https://github.com/nucypher/ferveo/commit/fd47f97510fad4132712dc58714c19fc0fd0d7e4)) + - Simple tdec on server side ([`39f7f39`](https://github.com/nucypher/ferveo/commit/39f7f39cf618e6c46a809707cfc93bf1aae4e49e)) + - Sketch the server api ([`5ba7451`](https://github.com/nucypher/ferveo/commit/5ba7451f1ae54995e90570b2e970263124ffa803)) + - Switch to cargo-criterion in ci ([`3a216b6`](https://github.com/nucypher/ferveo/commit/3a216b63ee47907e8838a6fcec4abc06fa517d12)) + - Fix benchmark not working on ci ([`e69c735`](https://github.com/nucypher/ferveo/commit/e69c735712ff8e85ae025b841287b645a94e3147)) + - Merge pull request #38 from nucypher/validity-checks ([`168bde6`](https://github.com/nucypher/ferveo/commit/168bde69694089000d8363fba08dd86cc6e101ce)) + - Merge pull request #19 from piotr-roslaniec/use-sha256 ([`ace45c7`](https://github.com/nucypher/ferveo/commit/ace45c783ba0d9b8ba2f308aa5c8a1af034d65ca)) + - Apply pr suggestions ([`1f76347`](https://github.com/nucypher/ferveo/commit/1f76347c0326424c5776c0e2a99c833d911c9b95)) + - Merge branch 'main' into use-sha256 ([`fa1c1a8`](https://github.com/nucypher/ferveo/commit/fa1c1a8bf2b338cb379a481d8b042c45af23c470)) + - Update tpke client api ([`33b2b09`](https://github.com/nucypher/ferveo/commit/33b2b0954d08261e72a7d206446a689fc6b251ac)) + - Refactor validator checksums into a struct ([`3366d80`](https://github.com/nucypher/ferveo/commit/3366d8011d960c4e493548011ba9610155d8360d)) + - Convert `api` and `serialization` to features ([`c20ac5e`](https://github.com/nucypher/ferveo/commit/c20ac5ec71b56336bfcccd3d308b32643122f3c7)) + - Self review ([`2c1ed0c`](https://github.com/nucypher/ferveo/commit/2c1ed0c0ea8fe60dfb95a3801de51ac8e7b29710)) + - Integrate light tdec into ferveo crate ([`5eb4fcf`](https://github.com/nucypher/ferveo/commit/5eb4fcfdf6ae19dda06871eb09155f067fb97645)) + - Refactor light tdec ([`20dbfec`](https://github.com/nucypher/ferveo/commit/20dbfec954af517bd9764e81b4bf97abe94ac10d)) + - Fix after merge ([`a6c3027`](https://github.com/nucypher/ferveo/commit/a6c30279d594c6441f111b300dbe836a801b0574)) + - Merge branch 'verify-simple-tdec-shares' into ferveo-pss ([`3693ba8`](https://github.com/nucypher/ferveo/commit/3693ba85e11ce2dbfc0d6202cb5eef0505b8f753)) + - Merge branch 'validity-checks' into verify-simple-tdec-shares ([`a34b995`](https://github.com/nucypher/ferveo/commit/a34b995d68258b0c956cff87dafa2f968f7ab0ef)) + - Merge branch 'main' into validity-checks ([`dd9e458`](https://github.com/nucypher/ferveo/commit/dd9e4584f9b9715e5c63816234e1c0c0c63df5bc)) + - Benchmark size of pvss transcripts ([`6c28d48`](https://github.com/nucypher/ferveo/commit/6c28d48ddc8aa0805b0fdb634564a627baf1f52f)) + - Self review ([`2c9bfec`](https://github.com/nucypher/ferveo/commit/2c9bfec29abf83f7e50fe37b5aceb4908bd40416)) + - Merge pull request #50 from theref/tidy ([`af53b72`](https://github.com/nucypher/ferveo/commit/af53b72a466cce1dd7b745f60194eec2733899ad)) + - Integrate key recovery into ferveo ([`7aa400f`](https://github.com/nucypher/ferveo/commit/7aa400f58a2ca766f36b50a248625aa2d3f2b7f1)) + - Refactor tdec recovery tests in tpke ([`a366089`](https://github.com/nucypher/ferveo/commit/a3660896800cfa35ddab2c07fc1d7dada8f39adb)) + - Integrate key refreshing into ferveo ([`0223a16`](https://github.com/nucypher/ferveo/commit/0223a1623d8f0d4aa0ade9ccf5f33a235cea57cb)) + - Merge pull request #32 from nucypher/simple-decryption-precomputed ([`cd50056`](https://github.com/nucypher/ferveo/commit/cd50056e1f36a7485b7f974e40e4c6584241d151)) + - Refactor key refreshing ([`864dbc2`](https://github.com/nucypher/ferveo/commit/864dbc26cbc6863b7eda7c03ed8e585d0a7159d8)) + - Remove unused code from `hash_to_curve` ([`1e2dee0`](https://github.com/nucypher/ferveo/commit/1e2dee03e06dd66cc0ad2b55548d5ec254da68a0)) + - Merge pull request #41 from theref/refresh_bench ([`0f1ac6f`](https://github.com/nucypher/ferveo/commit/0f1ac6ff8743ac7cd0fe3c99a0ef22d6bbb20425)) + - Replace `bench_with_input` for `bench_function` ([`bf16483`](https://github.com/nucypher/ferveo/commit/bf164835aedf6aba67c936a5c088528ac9eb9a83)) + - Add a benchmark sketch ([`aa75f85`](https://github.com/nucypher/ferveo/commit/aa75f85e17699cb84926fa33b1cd800d18abac6e)) + - Apply pr suggestions ([`bdda3d1`](https://github.com/nucypher/ferveo/commit/bdda3d11f0415e86ecf5ce9a5793b3b407d97c8f)) + - Self review ([`0eb043e`](https://github.com/nucypher/ferveo/commit/0eb043ed5e1fb54f71288362706c3d47c975bdf4)) + - Fix after rebase ([`2b298af`](https://github.com/nucypher/ferveo/commit/2b298af13302b7ddff8a7db1e41bd2e52d564dd0)) + - Apply PR suggestions ([`2c46d1e`](https://github.com/nucypher/ferveo/commit/2c46d1eaddd7f51878966667d8b42933e2fc69ea)) + - Fix after rebase ([`208c55e`](https://github.com/nucypher/ferveo/commit/208c55e76a2a483d2370534c48d9e6e145df1f6f)) + - Self review ([`0370bd9`](https://github.com/nucypher/ferveo/commit/0370bd99177e1953cdfdb90007a0a49bf21c7274)) + - Fix after rebase ([`e8b83dc`](https://github.com/nucypher/ferveo/commit/e8b83dc89f712e17eac42952a392bb13419f9f01)) + - Implement and benchmark subvariant of simple tdec ([`1bde49d`](https://github.com/nucypher/ferveo/commit/1bde49d8c1920f94cf3d33ca6bb705e667eda22c)) + - Benchmark share combination for simple variant ([`ec84ec3`](https://github.com/nucypher/ferveo/commit/ec84ec39d55d2a18ebca80e8c257aa872038d87c)) + - Merge branch 'main' into validity-checks ([`208d95c`](https://github.com/nucypher/ferveo/commit/208d95c990084f81eb2e82339e772b0baa8c7748)) + - Merge pull request #27 from nucypher/dkg-pvss-flow ([`e842b8a`](https://github.com/nucypher/ferveo/commit/e842b8a5bb2cafe2e768ca29e5f0210f969ea748)) + - Benchmark share verification ([`d499c28`](https://github.com/nucypher/ferveo/commit/d499c2820d8c0cbe959c8092fdefd632da2357af)) + - Refactor decryption share creation ([`64f5023`](https://github.com/nucypher/ferveo/commit/64f5023663ccf6f33b82e87a21b9c89eb7b135ac)) + - Implement simple tdec decryption share verification ([`655e5e3`](https://github.com/nucypher/ferveo/commit/655e5e3a9173d6e38ad176efecd0d380f19578f1)) + - Disable arkworks benchmark ([`91fa243`](https://github.com/nucypher/ferveo/commit/91fa24391002b2c75ff32bf8f0d50c5cbe2faa38)) + - Benchmark ciphertext validity check ([`a21fb93`](https://github.com/nucypher/ferveo/commit/a21fb93b84a11d77eb454c0a399da1e28a1f5140)) + - Update tpke/benches/tpke.rs ([`2d20f28`](https://github.com/nucypher/ferveo/commit/2d20f285ed97f3fe44bf7225bf7bc5e88842b753)) + - Bench ciphertext validity check ([`f0864ae`](https://github.com/nucypher/ferveo/commit/f0864ae82d3b1e8bf06877eb5e84e641d15088dd)) + - Enable key share blinding in fast tdec ([`57c9763`](https://github.com/nucypher/ferveo/commit/57c9763712be26ecf9e39863b9a37785b2da6c3e)) + - Refactor to a single share per validator ([`dce013c`](https://github.com/nucypher/ferveo/commit/dce013c0825ad5cabf7fe74edfc9d96ce80a44da)) + - Remove rebasing artifact ([`e9d7064`](https://github.com/nucypher/ferveo/commit/e9d706481adb3010924c2fc5014d4fff96e742fd)) + - Fix after rebase ([`dc53f7b`](https://github.com/nucypher/ferveo/commit/dc53f7b568abe296f2f0812b8233e5e388965277)) + - Fix after rebase ([`50343e3`](https://github.com/nucypher/ferveo/commit/50343e33d1c48e5199bac79f4d75031857fd0a7a)) + - Self code review ([`b560ad6`](https://github.com/nucypher/ferveo/commit/b560ad6e5e72a4b1521486cbc90e84fcbff2ed6f)) + - Remove dealer's lagrange coeffs calculation ([`f526ad4`](https://github.com/nucypher/ferveo/commit/f526ad44a8c05151bc7c0d745770e6b7f88e1876)) + - Simple threshold decryption works ([`d3c76cd`](https://github.com/nucypher/ferveo/commit/d3c76cde43f13a9a7c24d24511acbd980b5b6e44)) + - Fix clippy ([`cca3270`](https://github.com/nucypher/ferveo/commit/cca32700b3b13aafab6fcb899f852d3643dddcfd)) + - Simple decryption with one validator works with ferveo dkg ([`4fbaab3`](https://github.com/nucypher/ferveo/commit/4fbaab341e8481d7fbcf103e8b9c29b0a7ea348a)) + - Incorrect length of decrypted shares after pvss combination ([`efa6150`](https://github.com/nucypher/ferveo/commit/efa6150f3aa07e262290392f41dfa37c83a7a4a4)) + - Calculate lagrange using public context ([`0c6b9c5`](https://github.com/nucypher/ferveo/commit/0c6b9c560d934c3b4edab8866a4234461bc70274)) + - Calculate lagrange using private context ([`bd5d743`](https://github.com/nucypher/ferveo/commit/bd5d74385017b80324c2c9d882f2f727ece3bef5)) + - Initial work on simple threshold decryption ([`fcab224`](https://github.com/nucypher/ferveo/commit/fcab224a9ec79799ec7067e94a5e567ff91b83d4)) + - Refactor share verification ([`249c3c1`](https://github.com/nucypher/ferveo/commit/249c3c1b3285b4e8e92ee1b444e6f3b3d8001578)) + - Implement simplified decryption share verification ([`20445cd`](https://github.com/nucypher/ferveo/commit/20445cdc49712f40fb893f370d9510edf4cf7484)) + - Fix formulas ([`444ff80`](https://github.com/nucypher/ferveo/commit/444ff806b0bee35ef4edfb60c01caed67ae27cbc)) + - Fix after rebase ([`c80a197`](https://github.com/nucypher/ferveo/commit/c80a1975c9dcf130723ee46ce11bfb8b693301ef)) + - Decryption share verification for fast variant ([`a0d9930`](https://github.com/nucypher/ferveo/commit/a0d99308c932fda7413fc04f9039f9758d8a692e)) + - Check ciphertext validity before creating a decryption share ([`e99f43c`](https://github.com/nucypher/ferveo/commit/e99f43c3a3f0095e3989f1231c2b5f8d96f8471a)) + - Enable key share blinding in fast tdec ([`a484971`](https://github.com/nucypher/ferveo/commit/a484971aea27a5304aa20fbde6f826900107559e)) + - Refactor to a single share per validator ([`b6c9189`](https://github.com/nucypher/ferveo/commit/b6c9189322f3c50ccef19ad6cb0c4cd922a71f1b)) + - Remove rebasing artifact ([`838d3d2`](https://github.com/nucypher/ferveo/commit/838d3d21fd99799aea19843c3868476b0f6d97b4)) + - Fix after rebase ([`26fe690`](https://github.com/nucypher/ferveo/commit/26fe690d14dc29231886f593065d94193a3f913e)) + - Fix after rebase ([`668184c`](https://github.com/nucypher/ferveo/commit/668184c4b8b4fc38542be7de3bbeb49ab51166f2)) + - Self code review ([`89ebffc`](https://github.com/nucypher/ferveo/commit/89ebffc583ee13bc5b19a846fef168663e106bcb)) + - Remove dealer's lagrange coeffs calculation ([`364580e`](https://github.com/nucypher/ferveo/commit/364580eee849b5bdab88ee51a6116f90ce5a8199)) + - Simple threshold decryption works ([`856790c`](https://github.com/nucypher/ferveo/commit/856790c48d882c87275ddf6d87bbeb1a31ad559b)) + - Fix clippy ([`7cad9ae`](https://github.com/nucypher/ferveo/commit/7cad9aea331ed8e510bca6afd043fe61a466ef08)) + - Simple decryption with one validator works with ferveo dkg ([`57255f5`](https://github.com/nucypher/ferveo/commit/57255f5befb64f3c4cce8d97b2d28db0f0c4f0eb)) + - Incorrect length of decrypted shares after pvss combination ([`81d4dd2`](https://github.com/nucypher/ferveo/commit/81d4dd2c67026f2a672c2c421efa38bdfc5f226b)) + - Calculate lagrange using public context ([`17cdb5b`](https://github.com/nucypher/ferveo/commit/17cdb5b6850c54815f3629fa4e441e0caa815f7e)) + - Calculate lagrange using private context ([`719b4a1`](https://github.com/nucypher/ferveo/commit/719b4a1aa1d7775413c3a80500ecc87cc83d64ea)) + - Initial work on simple threshold decryption ([`08bac73`](https://github.com/nucypher/ferveo/commit/08bac73b78f602f4bc46ef4eb508c0870124094b)) + - Add benchmark for share refresh ([`5163ba6`](https://github.com/nucypher/ferveo/commit/5163ba62402c451b3ba5f52592eace2e6f43f4ec)) + - Merge pull request #34 from nucypher/benchmarks-pr-compare ([`185822b`](https://github.com/nucypher/ferveo/commit/185822b781ec6febfef28660acbe6fa39dd893a4)) + - Update random polynomial benchmark ([`770d251`](https://github.com/nucypher/ferveo/commit/770d2515b56438c30fdf0911ffb7b7103ba17b88)) + - Fix benchmarks on ci ([`33cf5c2`](https://github.com/nucypher/ferveo/commit/33cf5c2f7ed7c0971c2f349e38df24047b1ea4f6)) + - Fix after rebase ([`ea19e6a`](https://github.com/nucypher/ferveo/commit/ea19e6a8dffd3519ed51909b57820cae7ac61731)) + - Add more tpke benchmarks ([`02827bb`](https://github.com/nucypher/ferveo/commit/02827bb98ff2f2ec01c77c1283e8e79aefde0d3c)) + - Benchmark share combination for simple variant ([`07cbe25`](https://github.com/nucypher/ferveo/commit/07cbe25e24fef7f84523a7485bd71cc57e2f0753)) + - Fix polynomial benchmark ([`939f913`](https://github.com/nucypher/ferveo/commit/939f913507587fbbe7b0aaa88df11dfbaf52a823)) + - Add benchmark for Recover Share at Point ([`a8009a9`](https://github.com/nucypher/ferveo/commit/a8009a9fe7e4d5f5f7e2e923e2941e88024edaac)) + - Merge pull request #35 from nucypher/bench-arkworks ([`48567a3`](https://github.com/nucypher/ferveo/commit/48567a3d28718f354913c74580f5c9b9f964bb51)) + - Fix after rebase ([`d6af087`](https://github.com/nucypher/ferveo/commit/d6af0877ca201c027681550e72bb71834af67034)) + - Move poly bench to arkworks ([`f98b528`](https://github.com/nucypher/ferveo/commit/f98b5281af6a81ebaeb3c570d8965ee81a74b185)) + - Fix after rebase ([`27f9216`](https://github.com/nucypher/ferveo/commit/27f92163b343c9f8d8345a80e65e2ecec2ed58b7)) + - Simplify arkworks benchmarks ([`1b6b852`](https://github.com/nucypher/ferveo/commit/1b6b852f3b815a5635de807f675aa3780f3c039f)) + - Fix benchmark not working on ci ([`15e1c6e`](https://github.com/nucypher/ferveo/commit/15e1c6ec38cdfc63bca32e4b869c5e7a884f754f)) + - Fix after rebase ([`c192dfc`](https://github.com/nucypher/ferveo/commit/c192dfc64ebecdcc035d222696da481982c49f27)) + - Enable tpke benchmarks ([`73bc0a1`](https://github.com/nucypher/ferveo/commit/73bc0a14eacf37389694cabfa2949b6353e12737)) + - Add remaining benchmarks ([`14240f9`](https://github.com/nucypher/ferveo/commit/14240f989c1a1b4bde6c1310015c6e3fa783b045)) + - Add a benchmark sketch ([`1a1f5bc`](https://github.com/nucypher/ferveo/commit/1a1f5bc6672b096f5ebbaea85261ea94c2435553)) + - Add encryption and decryption benchmarks ([`1d02339`](https://github.com/nucypher/ferveo/commit/1d02339d7871a4e4637fbbd4fd349780edb4c591)) + - Add more tpke benchmarks ([`ac5bbac`](https://github.com/nucypher/ferveo/commit/ac5bbaccc959a5bf3076a0f9540b207e20aa09b5)) + - Run benchmarks on gh actions ([`20e1123`](https://github.com/nucypher/ferveo/commit/20e1123578295c5286b0ab1698ea7ea97aaa4397)) + - Benchmark share combination for simple variant ([`6b33e84`](https://github.com/nucypher/ferveo/commit/6b33e84ab428fcb903efffcc2e6178a50d47d04a)) + - Merge pull request #25 from piotr-roslaniec/sd-benchmarks ([`25c745e`](https://github.com/nucypher/ferveo/commit/25c745e3e830fab8161612af6963bc673ce00bb2)) + - Fix after rebase ([`3ee6ac5`](https://github.com/nucypher/ferveo/commit/3ee6ac5994c25e485a41e18acd1c438cb162bc66)) + - Add encryption and decryption benchmarks ([`c007f5e`](https://github.com/nucypher/ferveo/commit/c007f5e2fe6bf54ad294d94c0a7777613d4c7331)) + - Set group benchmark sample for tpke ([`0271631`](https://github.com/nucypher/ferveo/commit/0271631de705991dab5a30abe8c13a2d0ac80978)) + - Add more tpke benchmarks ([`3d5847b`](https://github.com/nucypher/ferveo/commit/3d5847b382604bb0fb4c2e213ac16ef22b7a5c50)) + - Run benchmarks on gh actions ([`ffd67c4`](https://github.com/nucypher/ferveo/commit/ffd67c47238b3dd5d9273ff8e0ba1979d10d4732)) + - Benchmark share combination for simple variant ([`5751d8c`](https://github.com/nucypher/ferveo/commit/5751d8c1df9ffce19b63fba3ae04fa050b4b511e)) + - Merge pull request #26 from nucypher/share-recovery ([`94de0a0`](https://github.com/nucypher/ferveo/commit/94de0a002b44daad34bcdf07d773fa4d8148787d)) + - Merge pull request #37 from theref/share-recovery ([`86a95f3`](https://github.com/nucypher/ferveo/commit/86a95f32403ed6df1c6cb77ba284dffb0eee2df9)) + - Apply PR suggestions ([`d8d325c`](https://github.com/nucypher/ferveo/commit/d8d325ce88f957c6c97fe5e4c58943bb6a2fc10f)) + - Use `debug_assert` to make benchmarks more consistent ([`871fdf4`](https://github.com/nucypher/ferveo/commit/871fdf4b8734fb0d55e9aed095557cbe3e61cedf)) + - Use arkworks for polynomails and benchmark relevant functions ([`92f6f55`](https://github.com/nucypher/ferveo/commit/92f6f551bbbaba5229ae8f3628b8d89147c8fe1a)) + - Fix after rebase ([`989415a`](https://github.com/nucypher/ferveo/commit/989415a9581063cc1105a7b361f79d780bf55111)) + - Apply pr suggestions ([`48732e7`](https://github.com/nucypher/ferveo/commit/48732e7d6e221ff985bde4fca35a0137f2ce123a)) + - Add comments after initial review ([`5456c42`](https://github.com/nucypher/ferveo/commit/5456c422a9f9b2a3964c2d3dd8de5700f0dccdd3)) + - Fix after rebase ([`7d5ecd9`](https://github.com/nucypher/ferveo/commit/7d5ecd9a54873719f0a1f1ec42957eb94ff97945)) + - Fix clippy warnings ([`2327378`](https://github.com/nucypher/ferveo/commit/232737832b34658df95a500b61fe856d7bd767f1)) + - Share refreshing ([`e4e59c8`](https://github.com/nucypher/ferveo/commit/e4e59c8ce60c440c308748097db1423763a358f7)) + - Refreshing initial pass ([`1697924`](https://github.com/nucypher/ferveo/commit/1697924d35d2c0e689ccd20f4f784be2d03c70b6)) + - Fix after rebase ([`c0df26e`](https://github.com/nucypher/ferveo/commit/c0df26e23e31107e24cfcad0319ff38cc17e5d19)) + - Failing to create a proper polynomial for recovery ([`2575edd`](https://github.com/nucypher/ferveo/commit/2575edd70e5d312e83bbc011c54c666bc7312d42)) + - Wip ([`81870af`](https://github.com/nucypher/ferveo/commit/81870afb4381a7acf7fb773c88b4508bd1d507dc)) + - Initial work on simple threshold decryption ([`3d0c13b`](https://github.com/nucypher/ferveo/commit/3d0c13b78fa89e3cf221e48c68f9ce7f97dbce17)) + - Merge pull request #20 from piotr-roslaniec/simple-decryption ([`b2b4809`](https://github.com/nucypher/ferveo/commit/b2b48091092c861ca7a39fcc54573dcd8117db2e)) + - Apply pr suggestions ([`6dc7173`](https://github.com/nucypher/ferveo/commit/6dc71731e880fdb8c7bd27da7e48649d18fff80f)) + - Remove some comments ([`526d198`](https://github.com/nucypher/ferveo/commit/526d19887686d94b09aa3b389b58b1f065938352)) + - Implement simple threshold decryption variant ([`e7ecab0`](https://github.com/nucypher/ferveo/commit/e7ecab0e1b9b310490e7f7ccf6deb73d08c866b4)) + - Use sha256 instead of blake2b ([`c71dbf2`](https://github.com/nucypher/ferveo/commit/c71dbf2630ebb54a4be725af92a61cfddc8837a0)) + - Merge pull request #10 from piotr-roslaniec/wasm-bindings ([`f26552d`](https://github.com/nucypher/ferveo/commit/f26552db645e095fb4df6732aa38e1fff1401d72)) + - Merge pull request #17 from nucypher/benchmark-wasm ([`85fba9e`](https://github.com/nucypher/ferveo/commit/85fba9e27de154b8b9701873ab1d370a07283fe3)) + - Merge pull request #18 from nucypher/bindings-python ([`227052a`](https://github.com/nucypher/ferveo/commit/227052aacd2b1a9353bfbf37d4522ff8f35d73a3)) + - Add python bindings and benchmark ([`0091ae1`](https://github.com/nucypher/ferveo/commit/0091ae1f8521337967a6dbb90157875a17fff7f9)) + - Add info about benchmark setup ([`c0c2c9e`](https://github.com/nucypher/ferveo/commit/c0c2c9e21f65eb2e6cf3a58b9952a3d9b0bb38f6)) + - Add benchmarks in the browser ([`1688c36`](https://github.com/nucypher/ferveo/commit/1688c36d9d2353a10d566db9b75424edd59a276d)) + - Update after rebase ([`d77f3b7`](https://github.com/nucypher/ferveo/commit/d77f3b79f6928198f84ce96ac306e0533c9977eb)) + - Panicks at 'capacity overflow' during js-benches ([`9d358e1`](https://github.com/nucypher/ferveo/commit/9d358e16acf3e033e5e5f8bef15a3b05d00d15c6)) + - Add bindings for threshold decryption flow ([`71ae0c3`](https://github.com/nucypher/ferveo/commit/71ae0c37131ab863caaff2ae13771304b1bbb5f7)) + - Expose randomness in dkg setup ([`d8b51ce`](https://github.com/nucypher/ferveo/commit/d8b51cea0b614efb89e2b17c8c23730268a0f65e)) + - Update after rebase ([`b8b2392`](https://github.com/nucypher/ferveo/commit/b8b2392de11068acde07895dc9b6897a742b9b2d)) + - Self review ([`7e92e0d`](https://github.com/nucypher/ferveo/commit/7e92e0d2e2b1d0f82ba0483bff0db0d59c079283)) + - Add bindings for threshold decryption flow ([`9fc2c4b`](https://github.com/nucypher/ferveo/commit/9fc2c4ba504c02bcc9b1d1b7fc990d2ebc37ba51)) + - Setup benchmarks ([`1b96071`](https://github.com/nucypher/ferveo/commit/1b960712911e2e02ae2f41e9e773134d8ccdbd96)) + - Add wasm setup ([`ca2e46e`](https://github.com/nucypher/ferveo/commit/ca2e46e67637ce34d531da03124523fb567b7002)) + - Merge pull request #8 from piotr-roslaniec/aad#1 ([`41b5408`](https://github.com/nucypher/ferveo/commit/41b54081c2061126fa8d661207e13aa74406733f)) + - Address pr comments ([`3786af1`](https://github.com/nucypher/ferveo/commit/3786af1e6a8c8ec26c82435f125f6d67c05884cd)) + - Expose checked decryption instead ([`cea2827`](https://github.com/nucypher/ferveo/commit/cea28279e3373d0e816d2986d860705c1893a11e)) + - Refactor u in ciphertext into commitment ([`5f5b5f3`](https://github.com/nucypher/ferveo/commit/5f5b5f35ea6d9460ebfa55e9aeeeb2ef46b76105)) + - Address pr comments ([`d9e43a4`](https://github.com/nucypher/ferveo/commit/d9e43a4cebaeb11a3e8c44bbef5933c5f52627ae)) + - Address pr comments ([`b44430b`](https://github.com/nucypher/ferveo/commit/b44430b32c251e202f7d29334468ac39e5185261)) + - Address some clippy warnings ([`e8087d2`](https://github.com/nucypher/ferveo/commit/e8087d23ec6d1845585016259e51cc173160bb92)) + - Refactor into a helper method ([`c56c025`](https://github.com/nucypher/ferveo/commit/c56c025c446c7824ebf19251ae0b3a354fd4f8b2)) + - Add checked decryption ([`e526c4f`](https://github.com/nucypher/ferveo/commit/e526c4f9db8ddaa406e31dd48c1b3cf00e2323e3)) + - Use aad in ciphertext validity check ([`0b252e5`](https://github.com/nucypher/ferveo/commit/0b252e50ac0017b0f4b6b4a94ad640d1911cc862)) + - Replace chacha20 with chacha20poly1305 ([`ce89ead`](https://github.com/nucypher/ferveo/commit/ce89eadb7737e511c743ec01a2fe3bfc9826b32c)) + - Merge pull request #65 from anoma/joe/20210922 ([`d6d603f`](https://github.com/nucypher/ferveo/commit/d6d603fbe82706525a194f42cbab9c3431dd7cc4)) + - Latest ferveo ([`0f17c3b`](https://github.com/nucypher/ferveo/commit/0f17c3be5cfa55b5f878defcb74ab2b4e13c3190)) + - Merge branch 'master' into joe/202108 ([`3e98e43`](https://github.com/nucypher/ferveo/commit/3e98e434758fadfdd16c73ba7ead15fc84005f99)) + - Merge pull request #50 from anoma/george/tpke ([`3e9eb73`](https://github.com/nucypher/ferveo/commit/3e9eb732b47787f55f818de8dbf9145a70b19130)) + - Moving tpke code in this repo ([`8d62e52`](https://github.com/nucypher/ferveo/commit/8d62e527ec5e792f62e885a25872fff45c1c3d00)) +
+ diff --git a/tpke/Cargo.toml b/tpke/Cargo.toml index 454533ed..c2dbd136 100644 --- a/tpke/Cargo.toml +++ b/tpke/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "group-threshold-cryptography-pre-release" -version = "0.1.0-alpha.0" +version = "0.1.0" edition = "2021" authors = ["Heliax AG ", "Piotr Roslaniec "] license = "GPL-3.0" @@ -24,7 +24,7 @@ ark-serialize = "0.4" ark-std = "0.4" bincode = "1.3.3" chacha20poly1305 = "0.10.1" -ferveo-common = { package = "ferveo-common-pre-release", path = "../ferveo-common", version = "0.1.0-alpha.0" } +ferveo-common = { package = "ferveo-common-pre-release", path = "../ferveo-common", version = "^0.1.0" } itertools = "0.10" miracl_core = "=2.3.0" rand = "0.8" @@ -33,7 +33,7 @@ serde = { version = "1.0", features = ["derive"] } serde_bytes = "0.11.9" serde_with = "2.0.1" sha2 = "0.10.6" -subproductdomain = { package = "subproductdomain-pre-release", path = "../subproductdomain", version = "0.1.0-alpha.0" } +subproductdomain = { package = "subproductdomain-pre-release", path = "../subproductdomain", version = "^0.1.0" } thiserror = "1.0" zeroize = "1.6.0" diff --git a/tpke/src/combine.rs b/tpke/src/combine.rs index 39091e88..a46477fb 100644 --- a/tpke/src/combine.rs +++ b/tpke/src/combine.rs @@ -161,13 +161,13 @@ mod tests { use ark_poly::EvaluationDomain; use ark_std::One; let fft_domain = - ark_poly::Radix2EvaluationDomain::::new(500).unwrap(); + ark_poly::GeneralEvaluationDomain::::new(500).unwrap(); let mut domain = Vec::with_capacity(500); let mut point = ScalarField::one(); for _ in 0..500 { domain.push(point); - point *= fft_domain.group_gen; + point *= fft_domain.group_gen(); } let mut lagrange_n_0 = domain.iter().product::(); diff --git a/tpke/src/decryption.rs b/tpke/src/decryption.rs index 9eb62471..c3b85eb5 100644 --- a/tpke/src/decryption.rs +++ b/tpke/src/decryption.rs @@ -166,7 +166,6 @@ impl DecryptionSharePrecomputed { g_inv: &E::G1Prepared, ) -> Result { check_ciphertext_validity::(ciphertext, aad, g_inv)?; - Self::create_unchecked( validator_index, validator_decryption_key, diff --git a/tpke/src/lib.rs b/tpke/src/lib.rs index 43ebdaa4..651935ae 100644 --- a/tpke/src/lib.rs +++ b/tpke/src/lib.rs @@ -94,8 +94,10 @@ pub mod test_common { DensePolynomial::::rand(threshold - 1, rng); // Domain, or omega Ω let fft_domain = - ark_poly::Radix2EvaluationDomain::::new(shares_num) - .unwrap(); + ark_poly::GeneralEvaluationDomain::::new( + shares_num, + ) + .unwrap(); // `evals` are evaluations of the polynomial f over the domain, omega: f(ω_j) for ω_j in Ω let evals = threshold_poly.evaluate_over_domain_by_ref(fft_domain); @@ -121,9 +123,9 @@ pub mod test_common { for _ in 0..shares_num { domain_points.push(point); // 1, t, t^2, t^3, ...; where t is a scalar generator fft_domain.group_gen - point *= fft_domain.group_gen; + point *= fft_domain.group_gen(); domain_points_inv.push(point_inv); - point_inv *= fft_domain.group_gen_inv; + point_inv *= fft_domain.group_gen_inv(); } let mut private_contexts = vec![]; @@ -193,8 +195,10 @@ pub mod test_common { DensePolynomial::::rand(threshold - 1, rng); // Domain, or omega Ω let fft_domain = - ark_poly::Radix2EvaluationDomain::::new(shares_num) - .unwrap(); + ark_poly::GeneralEvaluationDomain::::new( + shares_num, + ) + .unwrap(); // `evals` are evaluations of the polynomial f over the domain, omega: f(ω_j) for ω_j in Ω let evals = threshold_poly.evaluate_over_domain_by_ref(fft_domain);