Using new package pypicohsm.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2023-03-20 17:05:46 +01:00
parent a69d06b2d9
commit 11a30863e8
21 changed files with 104 additions and 857 deletions

View File

@@ -18,9 +18,8 @@
"""
import pytest
from utils import KeyType, DOPrefixes, Algorithm
from picohsm import KeyType, DOPrefixes
from binascii import hexlify
import hashlib
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives import hashes
@@ -43,6 +42,6 @@ def test_decrypt_rsa(device, modulus, pad):
message = data[:(modulus//8)-100]
ciphered = pubkey.encrypt(message, pad)
datab = device.decrypt(keyid, ciphered, pad)
device.delete_file(DOPrefixes.KEY_PREFIX.value << 8 | keyid)
device.delete_file(DOPrefixes.KEY_PREFIX, keyid)
assert(datab == message)