1
// ---------------------------------------------------------------------------
3
// - afnix:sec module - hashed key derivation function class definition -
4
// ---------------------------------------------------------------------------
5
// - This program is free software; you can redistribute it and/or modify -
6
// - it provided that this copyright notice is kept intact. -
8
// - This program is distributed in the hope that it will be useful, but -
9
// - without any warranty; without even the implied warranty of -
10
// - merchantability or fitness for a particular purpose. In no event shall -
11
// - the copyright holder be liable for any direct, indirect, incidental or -
12
// - special damages arising in any way out of the use of this software. -
13
// ---------------------------------------------------------------------------
14
// - copyright (c) 1999-2011 amaury darsch -
15
// ---------------------------------------------------------------------------
17
#ifndef AFNIX_HKDF_HPP
18
#define AFNIX_HKDF_HPP
24
#ifndef AFNIX_HASHER_HPP
30
/// The Hkdf class is an abstract class used to model key derivation
31
/// function based on hash function. The class maintains a hasher object
32
/// that is used to derive the key from an octer string.
33
/// @author amaury darsch
35
class Hkdf : public Kdf {
41
/// create a hashed kdf object by hasher and size
42
/// @param hobj the hasher object
43
/// @param name the kdf name
44
/// @param kbsz the key buffer size
45
Hkdf (Hasher* hobj, const String& name, const long kbsz);
47
/// destroy this hashed kdf object
50
/// @return the class name
51
String repr (void) const;
56
/// @return the hasher object
57
virtual Hasher* gethobj (void) const;
60
// make the copy constructor private
62
// make the assignment operator private
63
Hkdf& operator = (const Hkdf&);
66
/// @return true if the given quark is defined
67
bool isquark (const long quark, const bool hflg) const;
69
/// apply this object with a set of arguments and a quark
70
/// @param robj the current runnable
71
/// @param nset the current nameset
72
/// @param quark the quark to apply these arguments
73
/// @param argv the arguments to apply
74
Object* apply (Runnable* robj, Nameset* nset, const long quark,