Skip to content

Commit 2ebc08f

Browse files
dconnollychelseakomloisislovecruft
authored
Frost keygen with dealer (ZcashFoundation#47)
Implements FROST (Flexible Round Optimized Schnorr Threshold Signatures, https://eprint.iacr.org/2020/852) where key generation is performed by a trusted dealer. Future work will include implementing distributed key generation and re-randomizability. Co-authored-by: Chelsea Komlo <[email protected]> Co-authored-by: Isis Lovecruft <[email protected]>
1 parent 1e8fd46 commit 2ebc08f

15 files changed

+912
-4
lines changed

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2018"
66
# - Update CHANGELOG.md
77
# - Create git tag.
88
version = "0.2.2"
9-
authors = ["Henry de Valence <[email protected]>", "Deirdre Connolly <[email protected]>"]
9+
authors = ["Henry de Valence <[email protected]>", "Deirdre Connolly <[email protected]>", "Chelsea Komlo <[email protected]>"]
1010
readme = "README.md"
1111
license = "MIT OR Apache-2.0"
1212
repository = "https://github.com/ZcashFoundation/redjubjub"
@@ -25,6 +25,7 @@ jubjub = "0.3"
2525
rand_core = "0.5"
2626
serde = { version = "1", optional = true, features = ["derive"] }
2727
thiserror = "1.0"
28+
zeroize = { version = "1", default-features = false, features = ["zeroize_derive"] }
2829

2930
[dev-dependencies]
3031
bincode = "1"

LICENCE

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
This software is licensed optionally under either the MIT license or Apache 2.0
2+
license, the full text of which may be found respectively in the LICENCE.MIT and
3+
LICENCE.Apache-2.0 files contained within this software distribution.
4+
5+
==============================================================================
6+
7+
Portions of redjubjub are taken from curve25519-dalek, which can be found at
8+
<https://github.com/dalek-cryptography/curve25519-dalek>, under the following
9+
license. This implementation does NOT use the portions of curve25519-dalek
10+
which were originally derived from Adam Langley's Go edwards25519
11+
implementation, and, as such, that portion of the curve25519-dalek license is
12+
omitted here.
13+
14+
==============================================================================
15+
16+
Copyright (c) 2016-2021 Isis Agora Lovecruft, Henry de Valence. All rights reserved.
17+
18+
Redistribution and use in source and binary forms, with or without
19+
modification, are permitted provided that the following conditions are
20+
met:
21+
22+
1. Redistributions of source code must retain the above copyright
23+
notice, this list of conditions and the following disclaimer.
24+
25+
2. Redistributions in binary form must reproduce the above copyright
26+
notice, this list of conditions and the following disclaimer in the
27+
documentation and/or other materials provided with the distribution.
28+
29+
3. Neither the name of the copyright holder nor the names of its
30+
contributors may be used to endorse or promote products derived from
31+
this software without specific prior written permission.
32+
33+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
34+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
35+
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
36+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
37+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
38+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
39+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
40+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
41+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
42+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

LICENCE.MIT

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Copyright 2019-2021 Zcash Foundation
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7+
the Software, and to permit persons to whom the Software is furnished to do so,
8+
subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

LICENSE.Apache-2.0

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2019-2021 Zcash Foundation
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

src/batch.rs

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// -*- mode: rust; -*-
2+
//
3+
// This file is part of redjubjub.
4+
// Copyright (c) 2019-2021 Zcash Foundation
5+
// See LICENSE for licensing information.
6+
//
7+
// Authors:
8+
// - Deirdre Connolly <[email protected]>
9+
// - Henry de Valence <[email protected]>
10+
111
//! Performs batch RedJubjub signature verification.
212
//!
313
//! Batch verification asks whether *all* signatures in some set are valid,
@@ -136,11 +146,11 @@ impl Verifier {
136146
///
137147
/// The batch verification equation is:
138148
///
139-
/// h_G * -[sum(z_i * s_i)]P_G + sum([z_i]R_i + [z_i * c_i]VK_i) = 0_G
149+
/// h_G * -[sum(z_i * s_i)]P_G + sum(\[z_i\]R_i + [z_i * c_i]VK_i) = 0_G
140150
///
141151
/// which we split out into:
142152
///
143-
/// h_G * -[sum(z_i * s_i)]P_G + sum([z_i]R_i) + sum([z_i * c_i]VK_i) = 0_G
153+
/// h_G * -[sum(z_i * s_i)]P_G + sum(\[z_i\]R_i) + sum([z_i * c_i]VK_i) = 0_G
144154
///
145155
/// so that we can use multiscalar multiplication speedups.
146156
///
@@ -159,7 +169,7 @@ impl Verifier {
159169
/// signatures of each type in our batch, but we can still
160170
/// amortize computation nicely in one multiscalar multiplication:
161171
///
162-
/// h_G * ( [-sum(z_i * s_i): i_type == SpendAuth]P_SpendAuth + [-sum(z_i * s_i): i_type == Binding]P_Binding + sum([z_i]R_i) + sum([z_i * c_i]VK_i) ) = 0_G
172+
/// h_G * ( [-sum(z_i * s_i): i_type == SpendAuth]P_SpendAuth + [-sum(z_i * s_i): i_type == Binding]P_Binding + sum(\[z_i\]R_i) + sum([z_i * c_i]VK_i) ) = 0_G
163173
///
164174
/// As follows elliptic curve scalar multiplication convention,
165175
/// scalar variables are lowercase and group point variables

src/constants.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
// -*- mode: rust; -*-
2+
//
3+
// This file is part of redjubjub.
4+
// Copyright (c) 2019-2021 Zcash Foundation
5+
// See LICENSE for licensing information.
6+
//
7+
// Authors:
8+
// - Henry de Valence <[email protected]>
9+
110
/// The byte-encoding of the basepoint for `SpendAuthSig`.
211
// Extracted ad-hoc from librustzcash
312
// XXX add tests for this value.

src/error.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// -*- mode: rust; -*-
2+
//
3+
// This file is part of redjubjub.
4+
// Copyright (c) 2019-2021 Zcash Foundation
5+
// See LICENSE for licensing information.
6+
//
7+
// Authors:
8+
// - Deirdre Connolly <[email protected]>
9+
// - Henry de Valence <[email protected]>
10+
111
use thiserror::Error;
212

313
/// An error related to RedJubJub signatures.

0 commit comments

Comments
 (0)