Security Scol plugin
shark.h
Go to the documentation of this file.
1// shark.h - originally written and placed in the public domain by Wei Dai
2
6
7#ifndef CRYPTOPP_SHARK_H
8#define CRYPTOPP_SHARK_H
9
10#include "config.h"
11#include "seckey.h"
12#include "secblock.h"
13
14NAMESPACE_BEGIN(CryptoPP)
15
16
18struct SHARK_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<6, 2>
19{
20 CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "SHARK-E";}
21};
22
27{
30 class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SHARK_Info>
31 {
32 public:
33 void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &param);
34
35 protected:
36 unsigned int m_rounds;
37 SecBlock<word64> m_roundKeys;
38 };
39
42 class CRYPTOPP_NO_VTABLE Enc : public Base
43 {
44 public:
45 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
46
47 // used by Base to do key setup
48 void InitForKeySetup();
49
50 private:
51 static const byte sbox[256];
52 static const word64 cbox[8][256];
53 };
54
57 class CRYPTOPP_NO_VTABLE Dec : public Base
58 {
59 public:
60 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
61
62 private:
63 static const byte sbox[256];
64 static const word64 cbox[8][256];
65 };
66
67public:
70};
71
74
75NAMESPACE_END
76
77#endif
Provides class member functions to key a block cipher.
Definition seckey.h:318
Provides a base implementation of Algorithm and SimpleKeyingInterface for block ciphers.
Definition seckey.h:306
Inherited by algorithms with fixed block size.
Definition seckey.h:41
Inherited by keyed algorithms with fixed key length.
Definition seckey.h:125
Interface for retrieving values given their names.
Definition cryptlib.h:322
SHARK block cipher SHARK-E
Definition shark.h:27
Secure memory block with allocator and cleanup.
Definition secblock.h:731
Inherited by algorithms with variable number of rounds.
Definition seckey.h:65
Library configuration file.
Classes and functions for secure memory allocations.
Classes and functions for implementing secret key algorithms.
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher.
Definition seckey.h:399
SHARK block cipher information.
Definition shark.h:19