Merge pull request #422 from ethereum/JustinDrake-patch-1

Fix #320
This commit is contained in:
Danny Ryan 2019-01-10 12:27:53 -06:00 committed by GitHub
commit ab7f9d8f54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -71,8 +71,8 @@ q = 4002409555221667393417789825735904156556882819939007885332058136124031650490
def hash_to_G2(message: bytes32, domain: uint64) -> [uint384]:
# Initial candidate x coordinate
x_re = int.from_bytes(hash(bytes8(domain) + b'\x01' + message), 'big')
x_im = int.from_bytes(hash(bytes8(domain) + b'\x02' + message), 'big')
x_re = int.from_bytes(hash(message + bytes8(domain) + b'\x01'), 'big')
x_im = int.from_bytes(hash(message + bytes8(domain) + b'\x02'), 'big')
x_coordinate = Fq2([x_re, x_im]) # x = x_re + i * x_im
# Test candidate y coordinates until a one is found