You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: tss/rsa/README.md
+6-4
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
This is an implementation of ["Practical Threshold Signatures" by Victor Shoup](https://www.iacr.org/archive/eurocrypt2000/1807/18070209-new.pdf).
4
4
Protocol 1 is implemented.
5
5
6
-
## Threshold Primer
6
+
## Threshold Cryptography Primer
7
7
8
8
Let *l* be the total number of players, *t* be the number of corrupted players, and *k* be the threshold.
9
9
The idea of threshold signatures is that at least *k* players need to participate to form a valid signature.
@@ -13,7 +13,9 @@ Setup consists of a dealer generating *l* key shares from a key pair and "dealin
13
13
During the signing phase, at least *k* players use their key share and the message to generate a signature share.
14
14
Finally, the *k* signature shares are combined to form a valid signature for the message.
15
15
16
-
## Modifications
16
+
## Robustness
17
17
18
-
1. Our implementation is not robust. That is, the corrupted players can prevent a valid signature from being formed by the non-corrupted players. As such, we remove all verification.
19
-
2. The paper requires p and q to be safe primes. We do not.
18
+
The scheme requires p and q to be safe primes to provide robustness. That is, it is possible to validate (and reject) signature shares produced by malicious signers. RSA keys generated by the Go standard library are not guaranteed to be safe primes. In this case, the functions produces signature shares but they are not verifiable.
19
+
To provide verifiability, use the GenerateKey function in this package, which produces a key pair composed of safe primes.
20
+
21
+
The Deal function opportunistically checks whether the RSA key is composed of safe primes, if so, the signature shares produced are verifiable.
Copy file name to clipboardexpand all lines: tss/rsa/keyshare.go
+56
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,19 @@ import (
10
10
"math"
11
11
"math/big"
12
12
"sync"
13
+
14
+
"github.com/cloudflare/circl/zk/qndleq"
13
15
)
14
16
17
+
// VerifyKeys contains keys used to verify whether a signature share
18
+
// was computed using the signer's key share.
19
+
typeVerifyKeysstruct {
20
+
// This key is common to the group of signers.
21
+
GroupKey*big.Int
22
+
// This key is the (public) key associated with the (private) key share.
23
+
VerifyKey*big.Int
24
+
}
25
+
15
26
// KeyShare represents a portion of the key. It can only be used to generate SignShare's. During the dealing phase (when Deal is called), one KeyShare is generated per player.
16
27
typeKeySharestruct {
17
28
si*big.Int
@@ -21,6 +32,13 @@ type KeyShare struct {
21
32
22
33
Playersuint
23
34
Thresholduint
35
+
36
+
// It stores keys to produce verifiable signature shares.
37
+
// If it's nil, signature shares are still produced but
38
+
// they are not verifiable.
39
+
// This field is present only if the RSA private key is
// Deal takes in an existing RSA private key generated elsewhere. If cache is true, cached values are stored in KeyShare taking up more memory by reducing Sign time.
89
-
// See KeyShare documentation. Multi-prime RSA keys are unsupported.
Copy file name to clipboardexpand all lines: tss/rsa/signShare.go
+48
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,14 @@
1
1
package rsa
2
2
3
3
import (
4
+
"crypto/rsa"
4
5
"encoding/binary"
6
+
"errors"
5
7
"fmt"
6
8
"math"
7
9
"math/big"
10
+
11
+
"github.com/cloudflare/circl/zk/qndleq"
8
12
)
9
13
10
14
// SignShare represents a portion of a signature. It is generated when a message is signed by a KeyShare. t SignShare's are then combined by calling CombineSignShares, where t is the Threshold.
@@ -15,13 +19,52 @@ type SignShare struct {
15
19
16
20
Playersuint
17
21
Thresholduint
22
+
23
+
// It stores a DLEQ proof attesting that the signature
24
+
// share was computed using the signer's key share.
25
+
// If it's nil, signature share is not verifiable.
26
+
// This field is present only if the RSA private key is
0 commit comments