Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sharding_fork_choice_poc/beacon_chain_node.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from binascii import hexlify
from Crypto.Hash import keccak
from Crypto.Hash import SHA256
import random

def to_hex(s):
Expand All @@ -10,13 +10,13 @@ def to_hex(s):

def sha3(x):
if x not in memo:
memo[x] = keccak.new(digest_bits=256, data=x).digest()
memo[x] = SHA256.new(data=x).digest()
return memo[x]

def hash_to_int(h):
o = 0
for c in h:
o = (o << 8) + c
o = (o << 8) + ord(c)
return o

NOTARIES = 40
Expand Down