feisty meow concerns codebase 2.140
twofish_crypto.h
Go to the documentation of this file.
1#ifndef TWOFISH_CRYPTO_CLASS
2#define TWOFISH_CRYPTO_CLASS
3
4/*
5* Name : twofish_crypto
6* Author : Chris Koeritz
7* Purpose: provides twofish encryption using the openssl libraries.
8****
9* Copyright (c) 2005-$now By Author. This program is free software; you can
10* redistribute it and/or modify it under the terms of the GNU General Public
11* License as published by the Free Software Foundation; either version 2 of
12* the License or (at your option) any later version. This is online at:
13* http://www.fsf.org/copyleft/gpl.html
14* Please send any updates to: fred@gruntose.com
15*/
16
17#include <basis/byte_array.h>
18#include <basis/contracts.h>
19
21
22namespace crypto {
23
25{
26public:
29
35
36 twofish_crypto(const twofish_crypto &to_copy);
37
38 virtual ~twofish_crypto();
39
41
42 DEFINE_CLASS_NAME("twofish_crypto");
43
44 // twofish relevant values for appropriate key sizes.
47 static int static_minimum_key_size_in_bits() { return 92; }
48 /*
49 note that the lower bound above was discovered for openssl library through experimentation,
50 and is not officially documented for the twofish algorithm anywhere we can find (yet).
51 really contradictory results happened with lower key sizes, where many encrypt/decrypt cycles
52 would succeed on the same key length but then would trigger an 'invalid key length' error.
53 not the kind of deterministic behavior we might expect.
54 */
55 static int static_maximum_key_size_in_bits() { return 256; }
56};
57
58} //namespace.
59
60#endif
61
A very common template for a dynamic array of bytes.
Definition byte_array.h:36
DEFINE_CLASS_NAME("twofish_crypto")
static int static_maximum_key_size_in_bits()
virtual int minimum_key_size_in_bits() const
returns the minimum key size in bits supported here.
virtual int maximum_key_size_in_bits() const
returns the maximum key size in bits supported here.
static int static_minimum_key_size_in_bits()
twofish_crypto & operator=(const twofish_crypto &to_copy)