Skip to content

Commit b0dd4c8

Browse files
committed
Fixing DSA key pair generation
generator of 0 mustn't be accepted.
1 parent 6b87aba commit b0dd4c8

File tree

1 file changed

+1
-1
lines changed
  • ext/crypto/sagittarius/crypto/keys/operations/asymmetric

1 file changed

+1
-1
lines changed

ext/crypto/sagittarius/crypto/keys/operations/asymmetric/dsa.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
(let loop ()
195195
(let* ((h (random-range 2 (- p 2)))
196196
(g (mod-expt h e p)))
197-
(if (= g 1)
197+
(if (or (= g 1) (zero? g))
198198
(loop)
199199
g)))))
200200

0 commit comments

Comments
 (0)