File: test_hkdf.py

package info (click to toggle)
python-cryptography 46.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,684 kB
  • sloc: python: 52,706; java: 319; makefile: 160
file content (19 lines) | stat: -rw-r--r-- 517 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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
from cryptography.hazmat.primitives.kdf.hkdf import HKDF


def test_hkdf(benchmark):
    def bench():
        hkdf = HKDF(
            hashes.SHA512(),
            16000,
            salt=b"salt",
            info=b"info",
        )
        hkdf.derive(b"0" * 64)

    benchmark(bench)