Botan 1.10.17
ssl3_mac.h
Go to the documentation of this file.
1/*
2* SSL3-MAC
3* (C) 1999-2004 Jack Lloyd
4*
5* Distributed under the terms of the Botan license
6*/
7
8#ifndef BOTAN_SSL3_MAC_H__
9#define BOTAN_SSL3_MAC_H__
10
11#include <botan/hash.h>
12#include <botan/mac.h>
13
14namespace Botan {
15
16/**
17* A MAC only used in SSLv3. Do not use elsewhere! Use HMAC instead.
18*/
19class BOTAN_DLL SSL3_MAC : public MessageAuthenticationCode
20 {
21 public:
22 std::string name() const;
23 size_t output_length() const { return hash->output_length(); }
24 MessageAuthenticationCode* clone() const;
25
26 void clear();
27
29 {
30 return Key_Length_Specification(hash->output_length());
31 }
32
33 /**
34 * @param hash the underlying hash to use
35 */
37 ~SSL3_MAC() { delete hash; }
38 private:
39 void add_data(const byte[], size_t);
40 void final_result(byte[]);
41 void key_schedule(const byte[], size_t);
42
43 HashFunction* hash;
44 SecureVector<byte> i_key, o_key;
45 };
46
47}
48
49#endif
std::string name() const
Definition ssl3_mac.cpp:59
SSL3_MAC(HashFunction *hash)
Definition ssl3_mac.cpp:75
size_t output_length() const
Definition ssl3_mac.h:23
Key_Length_Specification key_spec() const
Definition ssl3_mac.h:28