You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@milagro.apache.org by ni...@apache.org on 2016/07/14 10:10:48 UTC

[04/11] incubator-milagro-mfa-server git commit: Updated MPIN function names

Updated MPIN function names


Project: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-server/commit/f04b2c86
Tree: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-server/tree/f04b2c86
Diff: http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-server/diff/f04b2c86

Branch: refs/heads/master
Commit: f04b2c86d174a802f53aba11722c51e51088c95e
Parents: c402ed1
Author: Kealan McCusker <ke...@certivox.com>
Authored: Tue May 10 22:01:04 2016 +0100
Committer: Vladislav Mitov <vl...@gmail.com>
Committed: Wed May 18 20:31:43 2016 +0300

----------------------------------------------------------------------
 lib/crypto.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-server/blob/f04b2c86/lib/crypto.py
----------------------------------------------------------------------
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)