Skip to content

Commit

Permalink
Fix to an example in the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Legrandin committed Oct 16, 2016
1 parent c59f087 commit 696d164
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Crypto/PublicKey/ElGamal.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@
>>> from Crypto import Random
>>> from Crypto.PublicKey import ElGamal
>>> from Crypto.Hash import SHA
>>> from Crypto.Math import Number
>>> from Crypto.Math import Numbers
>>>
>>> message = "Hello"
>>> key = ElGamal.generate(1024, Random.new().read)
>>> h = SHA.new(message).digest()
>>> while 1:
>>> k = Number.random_range(min_inclusive=1, min_exclusive=key.p-1)
>>> k = Numbers.random_range(min_inclusive=1, min_exclusive=key.p-1)
>>> if k.gcd(key.p-1)==1: break
>>> sig = key.sign(h,k)
>>> ...
Expand Down

0 comments on commit 696d164

Please sign in to comment.