#NEWLINE# def test_hmac( ) : #NEWLINE# #INDENT# keys = [ b'' , b'key' ] #NEWLINE# messages = [ b'' , b'The quick brown fox jumps over the lazy dog' ] #NEWLINE# answers = [ 'fbdb1d1b18aa6c08324b7d64b71fb76370690e1d' , 'de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9' ] #NEWLINE# for i in range ( len ( keys ) ) : #NEWLINE# #INDENT# if ( myhmac ( sha1_from_github , messages [ i ] , i [ i ] ) != answers [ i ] ) : #NEWLINE# #INDENT# print ( 'hmac error' ) #NEWLINE# exit ( ( - 1 ) )