Refactoring crypto base changes #1806

Merged
g1itch merged 14 commits from crypto-sort into v0.6 2021-08-17 15:07:33 +02:00
2 changed files with 9 additions and 3 deletions
Showing only changes of commit 01b0fee4b4 - Show all commits

View File

@ -5,7 +5,10 @@ import os
import unittest import unittest
from hashlib import sha256 from hashlib import sha256
from pybitmessage.pyelliptic import ECCBlind, ECCBlindChain, OpenSSL try:
from pyelliptic import ECCBlind, ECCBlindChain, OpenSSL
except ImportError:
from pybitmessage.pyelliptic import ECCBlind, ECCBlindChain, OpenSSL
# pylint: disable=protected-access # pylint: disable=protected-access

View File

@ -3,7 +3,10 @@ Test if OpenSSL is working correctly
""" """
import unittest import unittest
from pybitmessage.pyelliptic.openssl import OpenSSL try:
from pyelliptic.openssl import OpenSSL
except ImportError:
from pybitmessage.pyelliptic import OpenSSL
try: try:
OpenSSL.BN_bn2binpad OpenSSL.BN_bn2binpad
@ -33,7 +36,7 @@ class TestOpenSSL(unittest.TestCase):
@unittest.skipUnless(have_pad, 'Skipping OpenSSL pad test') @unittest.skipUnless(have_pad, 'Skipping OpenSSL pad test')
def test_padding(self): def test_padding(self):
"""Test an alternatie implementation of bn2binpad""" """Test an alternative implementation of bn2binpad"""
ctx = OpenSSL.BN_CTX_new() ctx = OpenSSL.BN_CTX_new()
a = OpenSSL.BN_new() a = OpenSSL.BN_new()