-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblock.h
37 lines (29 loc) · 822 Bytes
/
block.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
#ifndef BLOCK_H
#define BLOCK_H
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Block {
public:
// Block is used for the initial round to generate left and right sides of the 64 bit string.
Block(string = "");
// Returns the left side of the bit string
vector<int> getLeft();
// returns the righ side of the bit string
vector<int> getRight();
private:
vector<int> binaryPlainText;
vector<int> L;
vector<int> R;
string plainText;
// Converts the string of Hex chars to a 64 bit binary string
void convertString();
// Helper function to push the 4 bits of each hex char
void pushToBPT(int,int,int,int);
// Sends the string through the IP
void initialPermutation();
// Splits the 64 bit string into a right and left 32 bit strings.
void splitLeftRight();
};
#endif