9
9
10
10
class NISTTest (unittest .TestCase ):
11
11
12
- def _test_NIST_UseCase (self , nist_obj , testCase ):
12
+ def _test_NIST_UseCase (self , nist_obj , testCase , error_msg ):
13
13
nist_obj .set_hmac ( testCase ["digestmod" ], testCase ["ki" ] )
14
14
#ret = self.nist.derive_key( len(testCase["ko"])*8, testCase["fixedInput"] )
15
15
ret = nist_obj .derive_key ( testCase ["l" ], testCase ["fixedInput" ] )
16
- self .assertSequenceEqual (ret , testCase ["ko" ])
16
+ self .assertSequenceEqual (ret , testCase ["ko" ], error_msg )
17
17
18
18
def _test_using_hmac_library (self , generic_case ):
19
19
# less things to do because this test suite was originally conceived for hmac implementation
@@ -26,7 +26,7 @@ def _test_using_hmac_library(self, generic_case):
26
26
raise Exception ("Digest mode not considered." )
27
27
28
28
from kdf .lhmac import NIST
29
- self ._test_NIST_UseCase ( NIST (), case )
29
+ self ._test_NIST_UseCase ( NIST (), case , "hmac library based implementation" )
30
30
31
31
def _test_using_crypto_library (self , generic_case ):
32
32
case = generic_case .copy ()
@@ -45,7 +45,7 @@ def _test_using_crypto_library(self, generic_case):
45
45
case ["ko" ] = str (case ["ko" ])
46
46
47
47
from kdf .lcrypto import NIST
48
- self ._test_NIST_UseCase ( NIST (), case )
48
+ self ._test_NIST_UseCase ( NIST (), case , "crypto library based implementation" )
49
49
50
50
def test_NIST1 (self ):
51
51
"""
0 commit comments