From 75312c809cd4e6e03f5cd7b5c381252c5685f8e0 Mon Sep 17 00:00:00 2001 From: AliErcanOzgokce Date: Sun, 20 Oct 2024 20:01:19 +0300 Subject: [PATCH] Checking if privateRand is zero --- crypto/eots/eots.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crypto/eots/eots.go b/crypto/eots/eots.go index 5bb288980..d1f842a6f 100644 --- a/crypto/eots/eots.go +++ b/crypto/eots/eots.go @@ -65,6 +65,11 @@ func signHash(sk *PrivateKey, privateRand *PrivateRand, hash [32]byte) (*Signatu return nil, signatureError(ecdsa_schnorr.ErrPrivateKeyIsZero, str) } + // Check if nonce is zero + if privateRand.IsZero() { + return nil, errors.New("nonce (privateRand) is zero") + } + // d' = int(d) var privKeyScalar ModNScalar privKeyScalar.Set(&sk.Key)