Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to deterministic signatures #77

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
3 changes: 1 addition & 2 deletions covert/blockstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from concurrent.futures import ThreadPoolExecutor
from contextlib import suppress
from hashlib import sha512
from secrets import token_bytes

from nacl.exceptions import CryptoError

Expand Down Expand Up @@ -244,7 +243,7 @@ def encrypt_file(auth, blockinput, a):
a.filehash = blkhash
# Add signature blocks
for key in identities:
signature = xed_sign(key.sk, blkhash, token_bytes(64))
signature = xed_sign(key.sk, blkhash, blkhash) # blkhash is both the message and the nonce
nsig = sha512(blkhash + key.pk).digest()[:12]
ksig = blkhash[:32]
yield chacha.encrypt(signature, None, nsig, ksig)