-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKeccak1600.h
51 lines (38 loc) · 1.28 KB
/
Keccak1600.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* File: KeccakFull.h
* Author: ph4r05
*
* Created on June 19, 2014, 2:23 PM
*/
#ifndef KECCAKFULL_H
#define KECCAKFULL_H
#include <inttypes.h>
#include <string.h>
#include "base.h"
#include "ICipher.h"
#ifndef uint8_t
typedef unsigned char uint8_t;
#endif
#ifndef ROTL64
#define ROTL64(x, y) (((x) << (y)) | ((x) >> (64 - (y))))
#endif
class Keccak1600 : public ICipher {
private:
int rounds;
public:
Keccak1600();
virtual ~Keccak1600();
virtual unsigned getId() const { return 2; }
virtual unsigned getInputBlockSize() const { return 128; };
virtual unsigned getOutputBlockSize() const { return 128; };
virtual unsigned getKeyBlockSize() const { return 0; };
virtual int setNumRounds(int rounds);
virtual int getNumRounds() const { return this->rounds; }
virtual int evaluate(const unsigned char * input, unsigned char * output) const;
virtual int evaluate(const unsigned char *input, const unsigned char *key, unsigned char *output ) const;
inline virtual int prepareKey(const unsigned char * key)
{ return -1; }
inline virtual int evaluateWithPreparedKey(const unsigned char * input, unsigned char * output) const
{ return -1; }
};
#endif /* KECCAKFULL_H */