Switch to sslcrypto for cryptography tasks (#2338)
* Use sslcrypto instead of pyelliptic and pybitcointools * Fix CryptMessage * Support Python 3.4 * Fix user creation * Get rid of pyelliptic and pybitcointools * Fix typo * Delete test file * Add sslcrypto to tree * Update sslcrypto * Add pyaes to src/lib * Fix typo in tests * Update sslcrypto version * Use privatekey_bin instead of privatekey for bytes objects * Fix sslcrypto * Fix Benchmark plugin * Don't calculate the same thing twice * Only import sslcrypto once * Handle fallback sslcrypto implementation during tests * Fix sslcrypto fallback implementation selection
This commit is contained in:
parent
28fcf3c1ea
commit
fbc7b6fc4f
55 changed files with 3748 additions and 7287 deletions
|
@ -18,13 +18,10 @@ class TestCrypt:
|
|||
assert len(aes_key) == 32
|
||||
# assert len(encrypted) == 134 + int(len(text) / 16) * 16 # Not always true
|
||||
|
||||
ecc = CryptMessage.getEcc(self.privatekey)
|
||||
assert ecc.decrypt(encrypted) == text_repeated
|
||||
assert CryptMessage.eciesDecrypt(base64.b64encode(encrypted), self.privatekey) == text_repeated
|
||||
|
||||
def testDecryptEcies(self, user):
|
||||
encrypted = base64.b64decode(self.ecies_encrypted_text)
|
||||
ecc = CryptMessage.getEcc(self.privatekey)
|
||||
assert ecc.decrypt(encrypted) == b"hello"
|
||||
assert CryptMessage.eciesDecrypt(self.ecies_encrypted_text, self.privatekey) == b"hello"
|
||||
|
||||
def testPublickey(self, ui_websocket):
|
||||
pub = ui_websocket.testAction("UserPublickey", 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue