This repository has been archived on 2024-12-18. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2024-12-18/src/tests/test_blindsig.py

23 lines
568 B
Python
Raw Normal View History

"""
Test for ECC blind signatures
"""
import os
import unittest
2019-08-27 12:42:28 +02:00
from pybitmessage.pyelliptic.eccblind import ECCBlind
class TestBlindSig(unittest.TestCase):
"""
Test case for ECC blind signature
"""
def test_blind_sig(self):
"""Test full sequence using a random certifier key and a random message"""
blind_sig = ECCBlind()
blind_sig.signer_init()
msg = os.urandom(64)
blind_sig.create_signing_request(msg)
blind_sig.blind_sign()
blind_sig.unblind()
self.assertTrue(blind_sig.verify())