parent
c95ed063db
commit
33b5436dcc
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
find ../../mocks -name '*.py' | sort | while read module; do
|
||||
module=$(echo $module | sed 's:^\.\./\.\./mocks/::')
|
||||
find ../mocks -name '*.py' | sort | while read module; do
|
||||
module=$(echo $module | sed 's:^\.\./mocks/::')
|
||||
base=$(basename $module)
|
||||
# skip __init__.py
|
||||
if [[ $base == "__init__.py" ]]; then
|
@ -0,0 +1,8 @@
|
||||
import sys
|
||||
|
||||
sys.path.append('../src')
|
||||
sys.path.append('../src/lib')
|
||||
|
||||
import unittest
|
||||
|
||||
from ubinascii import hexlify, unhexlify
|
@ -1,11 +1,9 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from common import *
|
||||
|
||||
from trezor import config
|
||||
from trezor.crypto import random
|
||||
|
||||
from trezor import config
|
||||
|
||||
class TestConfig(unittest.TestCase):
|
||||
|
||||
def test_set_get(self):
|
@ -1,8 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto.aes import *
|
||||
|
@ -1,12 +1,9 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto import base58
|
||||
from trezor.crypto.hashlib import ripemd160
|
||||
|
||||
from trezor.crypto import base58
|
||||
|
||||
digestfunc_graphene = lambda x: ripemd160(x).digest()[:4]
|
||||
|
||||
class TestCryptoBase58(unittest.TestCase):
|
@ -1,14 +1,9 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto import bip32
|
||||
|
||||
SECP256K1_NAME = 'secp256k1'
|
||||
|
||||
|
||||
class TestCryptoBip32(unittest.TestCase):
|
||||
|
||||
def test_from_seed_invalid(self):
|
@ -1,8 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto import bip39
|
||||
|
@ -1,8 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto.curve import curve25519
|
||||
|
@ -1,12 +1,9 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto.curve import ed25519
|
||||
from trezor.crypto import random
|
||||
|
||||
from trezor.crypto.curve import ed25519
|
||||
|
||||
class TestCryptoEd25519(unittest.TestCase):
|
||||
|
||||
# vectors from https://github.com/torproject/tor/blob/master/src/test/ed25519_vectors.inc
|
@ -1,12 +1,9 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import hexlify, unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto.curve import nist256p1
|
||||
from trezor.crypto import random
|
||||
|
||||
from trezor.crypto.curve import nist256p1
|
||||
|
||||
class TestCryptoNist256p1(unittest.TestCase):
|
||||
|
||||
# vectors from http://point-at-infinity.org/ecc/nisttv
|
@ -1,12 +1,9 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import hexlify, unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto.curve import secp256k1
|
||||
from trezor.crypto import random
|
||||
|
||||
from trezor.crypto.curve import secp256k1
|
||||
|
||||
class TestCryptoSecp256k1(unittest.TestCase):
|
||||
|
||||
# vectors from https://crypto.stackexchange.com/questions/784/are-there-any-secp256k1-ecdsa-test-examples-available
|
@ -1,8 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto import hashlib
|
||||
|
@ -1,8 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto import hashlib
|
||||
|
@ -1,8 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto import hashlib
|
||||
|
@ -1,8 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto import hashlib
|
||||
|
@ -1,8 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto import hashlib
|
||||
|
@ -1,8 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto import hashlib
|
||||
|
@ -1,8 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto import hashlib
|
||||
|
@ -1,10 +1,7 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto import hashlib
|
||||
|
||||
from trezor.crypto import hmac
|
||||
|
||||
class TestCryptoHmac(unittest.TestCase):
|
@ -1,8 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import unhexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto import pbkdf2
|
||||
|
@ -1,8 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from ubinascii import hexlify
|
||||
from common import *
|
||||
|
||||
from trezor.crypto import random
|
||||
|
@ -1,7 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from common import *
|
||||
|
||||
from trezor import debug
|
||||
|
@ -1,7 +1,4 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from common import *
|
||||
|
||||
from trezor import utils
|
||||
|
@ -1,14 +1,12 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from common import *
|
||||
|
||||
import ustruct
|
||||
import ubinascii
|
||||
|
||||
from trezor.wire import wire_codec
|
||||
from trezor.utils import chunks
|
||||
from trezor.crypto import random
|
||||
from trezor.utils import chunks
|
||||
|
||||
from trezor.wire import wire_codec
|
||||
|
||||
class TestWireCodec(unittest.TestCase):
|
||||
# pylint: disable=C0301
|
@ -1,13 +1,12 @@
|
||||
import sys
|
||||
sys.path.append('..')
|
||||
sys.path.append('../lib')
|
||||
import unittest
|
||||
from common import *
|
||||
|
||||
import ustruct
|
||||
import ubinascii
|
||||
|
||||
from trezor.wire import wire_codec_v1
|
||||
from trezor.utils import chunks
|
||||
from trezor.crypto import random
|
||||
from trezor.utils import chunks
|
||||
|
||||
from trezor.wire import wire_codec_v1
|
||||
|
||||
class TestWireCodecV1(unittest.TestCase):
|
||||
# pylint: disable=C0301
|
Loading…
Reference in new issue