From 60265a3df950572fbcb7c56486a1b15f4c7ff52b Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Thu, 23 May 2024 16:59:43 +0200 Subject: [PATCH] chilldkg: Use proper random aux_bytes when signing --- reference/chilldkg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/chilldkg.py b/reference/chilldkg.py index a5b287d..49f0e18 100644 --- a/reference/chilldkg.py +++ b/reference/chilldkg.py @@ -1,4 +1,5 @@ # Reference implementation of BIP DKG. +from secrets import token_bytes as random_bytes from typing import Tuple, List, NamedTuple, NewType, Optional from secp256k1ref.secp256k1 import Scalar @@ -26,8 +27,7 @@ def certifying_eq_participant_step(hostseckey: bytes, x: bytes) -> bytes: - # TODO: fix aux_rand - return schnorr_sign(x, hostseckey, b"0" * 32) + return schnorr_sign(x, hostseckey, random_bytes(32)) def certifying_eq_verify(hostpubkeys: List[bytes], x: bytes, cert: bytes) -> bool: