You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@milagro.apache.org by km...@apache.org on 2019/05/30 09:04:34 UTC
[incubator-milagro-mfa-server] 05/31: Updated MPIN function names
This is an automated email from the ASF dual-hosted git repository.
kmccusker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-mfa-server.git
commit f04b2c86d174a802f53aba11722c51e51088c95e
Author: Kealan McCusker <ke...@certivox.com>
AuthorDate: Tue May 10 22:01:04 2016 +0100
Updated MPIN function names
---
lib/crypto.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/crypto.py b/lib/crypto.py
index b26ef6e..b3c87e1 100644
--- a/lib/crypto.py
+++ b/lib/crypto.py
@@ -47,7 +47,7 @@ def get_random_generator(seed):
# random number generator
RNG = mpin.ffi.new('csprng*')
- mpin.libmpin.CREATE_CSPRNG(RNG, SEED)
+ mpin.libmpin.MPIN_CREATE_CSPRNG(RNG, SEED)
return RNG
@@ -129,7 +129,7 @@ def aes_gcm_encrypt(master_secret, aes_key, rand, header, iv=mpin.IVL):
CIPHERTEXT[0].val = CIPHERTEXT_val
CIPHERTEXT[0].max = len(plaintext)
- mpin.libmpin.AES_GCM_ENCRYPT(AES_KEY, IV, HEADER, PLAINTEXT, CIPHERTEXT, TAG)
+ mpin.libmpin.MPIN_AES_GCM_ENCRYPT(AES_KEY, IV, HEADER, PLAINTEXT, CIPHERTEXT, TAG)
IV_hex = mpin.toHex(IV)
CIPHERTEXT_hex = mpin.toHex(CIPHERTEXT)
TAG_hex = mpin.toHex(TAG)
@@ -181,7 +181,7 @@ def aes_gcm_decrypt(aes_key, iv, header, ciphertext):
TAG[0].max = mpin.PAS
# Decrypt ciphertext
- mpin.libmpin.AES_GCM_DECRYPT(AES_KEY, IV, HEADER, CIPHERTEXT, PLAINTEXT, TAG)
+ mpin.libmpin.MPIN_AES_GCM_DECRYPT(AES_KEY, IV, HEADER, CIPHERTEXT, PLAINTEXT, TAG)
return mpin.toHex(TAG), mpin.toHex(PLAINTEXT)