diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2024-06-08 10:52:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-08 07:52:13 -0700 |
commit | f3b0e165f00c061f2151da23cd3973d5cd0d2e01 (patch) | |
tree | 6e8f519f965fab65c09c8ebed6209849d407d5b8 /tests | |
parent | 77f880246c1532a796fb146b13cfee7f54a5ce84 (diff) | |
download | pyca-cryptography-f3b0e165f00c061f2151da23cd3973d5cd0d2e01.zip pyca-cryptography-f3b0e165f00c061f2151da23cd3973d5cd0d2e01.tar.gz pyca-cryptography-f3b0e165f00c061f2151da23cd3973d5cd0d2e01.tar.bz2 |
Added a benchmark for fernet (#11088)
This tests many different primitives
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bench/test_fernet.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/bench/test_fernet.py b/tests/bench/test_fernet.py new file mode 100644 index 0000000..c550aa7 --- /dev/null +++ b/tests/bench/test_fernet.py @@ -0,0 +1,10 @@ +# 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 import fernet + + +def test_fernet_encrypt(benchmark): + f = fernet.Fernet(fernet.Fernet.generate_key()) + benchmark(f.encrypt, b"\x00" * 256) |