Botan 3.7.1
Crypto and TLS for C&
prf_x942.h
Go to the documentation of this file.
1/*
2* X9.42 PRF
3* (C) 1999-2007 Jack Lloyd
4*
5* Botan is released under the Simplified BSD License (see license.txt)
6*/
7
8#ifndef BOTAN_ANSI_X942_PRF_H_
9#define BOTAN_ANSI_X942_PRF_H_
10
11#include <botan/asn1_obj.h>
12#include <botan/kdf.h>
13
14namespace Botan {
15
16/**
17* PRF from ANSI X9.42
18*/
19class X942_PRF final : public KDF {
20 public:
21 std::string name() const override;
22
23 std::unique_ptr<KDF> new_object() const override { return std::make_unique<X942_PRF>(m_key_wrap_oid); }
24
25 explicit X942_PRF(std::string_view oid) : m_key_wrap_oid(OID::from_string(oid)) {}
26
27 explicit X942_PRF(const OID& oid) : m_key_wrap_oid(oid) {}
28
29 private:
30 void perform_kdf(std::span<uint8_t> key,
31 std::span<const uint8_t> secret,
32 std::span<const uint8_t> salt,
33 std::span<const uint8_t> label) const override;
34
35 private:
36 OID m_key_wrap_oid;
37};
38
39} // namespace Botan
40
41#endif
X942_PRF(std::string_view oid)
Definition prf_x942.h:25
std::string name() const override
Definition prf_x942.cpp:88
std::unique_ptr< KDF > new_object() const override
Definition prf_x942.h:23
X942_PRF(const OID &oid)
Definition prf_x942.h:27
int(* final)(unsigned char *, CTX *)