MCPcopy Create free account
hub / github.com/pyca/cryptography / test_load_hash_vectors

Function test_load_hash_vectors

tests/test_utils.py:297–326  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

295
296
297def test_load_hash_vectors():
298 vector_data = textwrap.dedent(
299 """
300
301 # https://tools.ietf.org/html/rfc1321
302 [irrelevant]
303
304 Len = 0
305 Msg = 00
306 MD = d41d8cd98f00b204e9800998ecf8427e
307
308 Len = 8
309 Msg = 61
310 MD = 0cc175b9c0f1b6a831c399e269772661
311
312 Len = 24
313 Msg = 616263
314 MD = 900150983cd24fb0d6963f7d28e17f72
315
316 Len = 112
317 Msg = 6d65737361676520646967657374
318 MD = f96b697d7cb7938d525a2f31aaf161d0
319 """
320 ).splitlines()
321 assert load_hash_vectors(vector_data) == [
322 (b"", "d41d8cd98f00b204e9800998ecf8427e"),
323 (b"61", "0cc175b9c0f1b6a831c399e269772661"),
324 (b"616263", "900150983cd24fb0d6963f7d28e17f72"),
325 (b"6d65737361676520646967657374", "f96b697d7cb7938d525a2f31aaf161d0"),
326 ]
327
328
329def test_load_hmac_vectors():

Callers

nothing calls this directly

Calls 1

load_hash_vectorsFunction · 0.85

Tested by

no test coverage detected