2019-08-26 17:46:25 +02:00
|
|
|
"""
|
|
|
|
Test for ECC blind signatures
|
|
|
|
"""
|
|
|
|
import os
|
|
|
|
import unittest
|
|
|
|
|
2019-08-27 12:42:28 +02:00
|
|
|
from pybitmessage.pyelliptic.eccblind import ECCBlind
|
2019-08-26 17:46:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
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())
|