-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathword.h
50 lines (35 loc) · 1.17 KB
/
word.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
#ifndef WORD_H
#define WORD_H
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include "byte.h"
using namespace std ;
class Word{
private:
int len ;
unsigned char *w ;
public:
Word(char *str, int l); // Length of the word in bytes, default being 4
Word(const Word& wo) ;
Word SubWord(); // Uses the S-box for byte-level substitution
void SubWord1(); // Uses the S-box for byte-level substitution
void InvSubWord1(); // Uses the S-box for byte-level substitution
Word RotWord(); // [a0, a1, a2, a3] -> [a1, a2, a3, a0]
Word XOR(Word); // Performs the XOR function on two words
void CircularLShift(int times=1); // Performs Circular left shift, by default one time
virtual void display(); // Display the word in the required format
unsigned char *to_Array(); // Returns the Word in array form
bool compare(Word&);
static Word Rcon(int);
void copyW(unsigned char *);
Word& operator=(const Word&) ;
void setW(int, unsigned char) ;
void WModProd(unsigned char, char *) ;
void Divide(Word, Word&, Word&) ;
void Inverse() ;
unsigned char* to_print(unsigned char *) ;
~Word() ;
};
#endif