summaryrefslogtreecommitdiffstats
path: root/module/lib/beaker/crypto/jcecrypto.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/lib/beaker/crypto/jcecrypto.py')
-rw-r--r--module/lib/beaker/crypto/jcecrypto.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/module/lib/beaker/crypto/jcecrypto.py b/module/lib/beaker/crypto/jcecrypto.py
index 4062d513e..ce313d6e1 100644
--- a/module/lib/beaker/crypto/jcecrypto.py
+++ b/module/lib/beaker/crypto/jcecrypto.py
@@ -16,6 +16,7 @@ import jarray
# Initialization vector filled with zeros
_iv = IvParameterSpec(jarray.zeros(16, 'b'))
+
def aesEncrypt(data, key):
cipher = Cipher.getInstance('AES/CTR/NoPadding')
skeySpec = SecretKeySpec(key, 'AES')
@@ -25,6 +26,7 @@ def aesEncrypt(data, key):
# magic.
aesDecrypt = aesEncrypt
+
def getKeyLength():
maxlen = Cipher.getMaxAllowedKeyLength('AES/CTR/NoPadding')
return min(maxlen, 256) / 8