Botan
1.10.17
src
kdf
prf_tls
prf_tls.h
Go to the documentation of this file.
1
/*
2
* TLS v1.0 and v1.2 PRFs
3
* (C) 2004-2010 Jack Lloyd
4
*
5
* Distributed under the terms of the Botan license
6
*/
7
8
#ifndef BOTAN_TLS_PRF_H__
9
#define BOTAN_TLS_PRF_H__
10
11
#include <botan/kdf.h>
12
#include <botan/mac.h>
13
#include <botan/hash.h>
14
15
namespace
Botan
{
16
17
/**
18
* PRF used in TLS 1.0/1.1
19
*/
20
class
BOTAN_DLL
TLS_PRF
:
public
KDF
21
{
22
public
:
23
SecureVector<byte>
derive
(
size_t
key_len,
24
const
byte
secret[],
size_t
secret_len,
25
const
byte
seed[],
size_t
seed_len)
const
;
26
27
std::string
name
()
const
{
return
"TLS-PRF"
; }
28
KDF
*
clone
()
const
{
return
new
TLS_PRF
; }
29
30
TLS_PRF
();
31
~TLS_PRF
();
32
private
:
33
MessageAuthenticationCode
* hmac_md5;
34
MessageAuthenticationCode
* hmac_sha1;
35
};
36
37
/**
38
* PRF used in TLS 1.2
39
*/
40
class
BOTAN_DLL
TLS_12_PRF
:
public
KDF
41
{
42
public
:
43
SecureVector<byte>
derive
(
size_t
key_len,
44
const
byte
secret[],
size_t
secret_len,
45
const
byte
seed[],
size_t
seed_len)
const
;
46
47
std::string
name
()
const
{
return
"TLSv12-PRF("
+ hmac->name() +
")"
; }
48
KDF
*
clone
()
const
{
return
new
TLS_12_PRF
(hmac->clone()); }
49
50
TLS_12_PRF
(
MessageAuthenticationCode
* hmac);
51
~TLS_12_PRF
();
52
private
:
53
MessageAuthenticationCode
* hmac;
54
};
55
56
}
57
58
#endif
Botan::KDF
Definition
kdf.h:21
Botan::MessageAuthenticationCode
Definition
mac.h:22
Botan::SecureVector
Definition
secmem.h:329
Botan::TLS_12_PRF
Definition
prf_tls.h:41
Botan::TLS_12_PRF::clone
KDF * clone() const
Definition
prf_tls.h:48
Botan::TLS_12_PRF::name
std::string name() const
Definition
prf_tls.h:47
Botan::TLS_12_PRF::TLS_12_PRF
TLS_12_PRF(MessageAuthenticationCode *hmac)
Definition
prf_tls.cpp:88
Botan::TLS_12_PRF::derive
SecureVector< byte > derive(size_t key_len, const byte secret[], size_t secret_len, const byte seed[], size_t seed_len) const
Definition
prf_tls.cpp:97
Botan::TLS_PRF
Definition
prf_tls.h:21
Botan::TLS_PRF::name
std::string name() const
Definition
prf_tls.h:27
Botan::TLS_PRF::derive
SecureVector< byte > derive(size_t key_len, const byte secret[], size_t secret_len, const byte seed[], size_t seed_len) const
Definition
prf_tls.cpp:68
Botan::TLS_PRF::TLS_PRF
TLS_PRF()
Definition
prf_tls.cpp:53
Botan::TLS_PRF::clone
KDF * clone() const
Definition
prf_tls.h:28
Botan
Definition
algo_base.h:14
Generated by
1.18.0