G parameter removed from ThresholdKey

G _MUST_ be always n+1 to make the threshold encryption algorithm safe. We assume G=n+1 both for standard and threshold version.
This commit is contained in:
Piotr Dyraga committed 2018-05-30 14:48:15 +02:00
1 parent e10b02e420
commit e25bc358e8
5 files changed
+4 -5

No files matched your search

+3
View File
@@ -37,6 +37,9 @@ func (pub *PublicKey) Encrypt(m *big.Int, random io.Reader) (*Cypher, error) {
}
nSquare := pub.GetNSquare()
// g is _always_ equal n+1
// Threshold encryption is safe only for g=n+1 choice.
// See [DJN 10], section 5.1
g := new(big.Int).Add(pub.N, big.NewInt(1))
gm := new(big.Int).Exp(g, m, nSquare)
rn := new(big.Int).Exp(r, pub.N, nSquare)