diff --git a/orchard_note.py b/orchard_note.py index d278442..e11a311 100644 --- a/orchard_note.py +++ b/orchard_note.py @@ -9,6 +9,7 @@ from utils import leos2bsp class OrchardNote(object): def __init__(self, d, pk_d, v, rho, rseed): + assert isinstance(v, int) self.d = d self.pk_d = pk_d self.v = v diff --git a/orchard_note_encryption.py b/orchard_note_encryption.py index 2b65946..6584721 100644 --- a/orchard_note_encryption.py +++ b/orchard_note_encryption.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import sys; assert sys.version_info[0] >= 3, "Python 3 required." +import struct from chacha20poly1305 import ChaCha20Poly1305 import os @@ -126,19 +127,20 @@ class TransmittedNoteCipherText(object): assert(leadbyte == 2) np = OrchardNotePlaintext( p_enc[1:12], # d - struct.unpack('