summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwayne Litzenberger <dlitz@dlitz.net>2013-10-20 17:46:14 -0700
committerDwayne Litzenberger <dlitz@dlitz.net>2013-10-20 17:48:54 -0700
commit7bb217aedd421fc89120baf98b719bf49c4f5fb7 (patch)
treea48788bf16521a2b9331b4847f7e681aae38cb99
parent141eee1093bc9adbbdc3b3b3e90bde868d46eeec (diff)
downloadpycrypto-7bb217aedd421fc89120baf98b719bf49c4f5fb7.tar.gz
Rename S2V -> _S2V until we come up with a real PRF API
-rw-r--r--lib/Crypto/Cipher/blockalgo.py4
-rw-r--r--lib/Crypto/Protocol/KDF.py4
-rw-r--r--lib/Crypto/SelfTest/Protocol/test_KDF.py6
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/Crypto/Cipher/blockalgo.py b/lib/Crypto/Cipher/blockalgo.py
index 98e0e00..84b9bc3 100644
--- a/lib/Crypto/Cipher/blockalgo.py
+++ b/lib/Crypto/Cipher/blockalgo.py
@@ -35,7 +35,7 @@ from Crypto.Util.number import long_to_bytes, bytes_to_long
import Crypto.Util.Counter
from Crypto.Hash import CMAC
from Crypto.Hash.CMAC import _SmoothMAC
-from Crypto.Protocol.KDF import S2V
+from Crypto.Protocol.KDF import _S2V
from Crypto.Util import galois
@@ -461,7 +461,7 @@ class BlockAlgo:
# IV is optional
self.nonce = _getParameter('nonce', 1, args, kwargs)
- self._cipherMAC = S2V(key[:subkey_size], ciphermod=factory)
+ self._cipherMAC = _S2V(key[:subkey_size], ciphermod=factory)
self._subkey_ctr = key[subkey_size:]
self._mac_len = factory.block_size
diff --git a/lib/Crypto/Protocol/KDF.py b/lib/Crypto/Protocol/KDF.py
index 127be0c..c5967e4 100644
--- a/lib/Crypto/Protocol/KDF.py
+++ b/lib/Crypto/Protocol/KDF.py
@@ -126,7 +126,7 @@ def PBKDF2(password, salt, dkLen=16, count=1000, prf=None):
i = i + 1
return key[:dkLen]
-class S2V(object):
+class _S2V(object):
"""String-to-vector PRF as defined in `RFC5297`_.
This class implements a pseudorandom function family
@@ -161,7 +161,7 @@ class S2V(object):
ciphermod : module
A block cipher module from `Crypto.Cipher`.
"""
- return S2V(key, ciphermod)
+ return _S2V(key, ciphermod)
new = staticmethod(new)
def _double(self, bs):
diff --git a/lib/Crypto/SelfTest/Protocol/test_KDF.py b/lib/Crypto/SelfTest/Protocol/test_KDF.py
index 37cfb55..de09b41 100644
--- a/lib/Crypto/SelfTest/Protocol/test_KDF.py
+++ b/lib/Crypto/SelfTest/Protocol/test_KDF.py
@@ -31,7 +31,7 @@ from Crypto.SelfTest.st_common import list_test_cases
from Crypto.Hash import SHA1, HMAC
from Crypto.Cipher import AES, DES3
-from Crypto.Protocol.KDF import PBKDF1, PBKDF2, S2V
+from Crypto.Protocol.KDF import PBKDF1, PBKDF2, _S2V
def t2b(t): return unhexlify(b(t))
@@ -127,7 +127,7 @@ class S2V_Tests(unittest.TestCase):
def test1(self):
"""Verify correctness of test vector"""
for tv in self._testData:
- s2v = S2V.new(t2b(tv[1]), tv[3])
+ s2v = _S2V.new(t2b(tv[1]), tv[3])
for s in tv[0]:
s2v.update(t2b(s))
result = s2v.derive()
@@ -138,7 +138,7 @@ class S2V_Tests(unittest.TestCase):
components are accepted."""
key = bchr(0)*16
for module in (AES, DES3):
- s2v = S2V.new(key, module)
+ s2v = _S2V.new(key, module)
max_comps = module.block_size*8-1
for i in xrange(max_comps):
s2v.update(b("XX"))