mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
Added a benchmark for hmac (#8776)
This commit is contained in:
parent
8397cd2a05
commit
1bc46c7298
1 changed files with 14 additions and 0 deletions
14
tests/bench/test_hmac.py
Normal file
14
tests/bench/test_hmac.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# This file is dual licensed under the terms of the Apache License, Version
|
||||
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
||||
# for complete details.
|
||||
|
||||
from cryptography.hazmat.primitives import hashes, hmac
|
||||
|
||||
|
||||
def test_hmac_sha256(benchmark):
|
||||
def bench():
|
||||
h = hmac.HMAC(b"my extremely secure key", hashes.SHA256())
|
||||
h.update(b"I love hashing. So much. The best.")
|
||||
return h.finalize()
|
||||
|
||||
benchmark(bench)
|
||||
Loading…
Reference in a new issue