Implemented proxies to pyca X25519

This commit is contained in:
Mark Qvist 2022-06-08 17:03:40 +02:00
parent e2aeb56c12
commit 94edc8eff3
6 changed files with 86 additions and 15 deletions

View file

@ -6,5 +6,19 @@ from .HKDF import hkdf
from .PKCS7 import PKCS7
from .Fernet import Fernet
import RNS.Cryptography.Provider as cp
if cp.PROVIDER == cp.PROVIDER_INTERNAL:
print("INTERNAL")
from RNS.Cryptography.X25519 import X25519PrivateKey, X25519PublicKey
# TODO: Use internal Ed25519
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey, Ed25519PublicKey
elif cp.PROVIDER == cp.PROVIDER_PYCA:
print("PYCA")
from RNS.Cryptography.Proxies import X25519PrivateKeyProxy as X25519PrivateKey
from RNS.Cryptography.Proxies import X25519PublicKeyProxy as X25519PublicKey
modules = glob.glob(os.path.dirname(__file__)+"/*.py")
__all__ = [ os.path.basename(f)[:-3] for f in modules if not f.endswith('__init__.py')]