-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestKeyScheduling.c
More file actions
44 lines (39 loc) · 914 Bytes
/
testKeyScheduling.c
File metadata and controls
44 lines (39 loc) · 914 Bytes
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
#include "DES.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main (int argc, char const *argv[])
{
KEY key = 0x133457799BBCDFF1;
KEY *keys = malloc(16*sizeof(KEY));
scheduleKeys(key, keys);
int i;
KEY keysCheck[16] = {
(KEY)29699430183026,
(KEY)133791886330341,
(KEY)94543139753881,
(KEY)126090959598877,
(KEY)137353186988968,
(KEY)109561366215471,
(KEY)260054766196924,
(KEY)272173063289851,
(KEY)247235160696705,
(KEY)195658438559311,
(KEY)36695460205446,
(KEY)129132311898089,
(KEY)166875887221313,
(KEY)104744453596986,
(KEY)210631860764426,
(KEY)223465186400245
};
for(i =0; i<16; i++){
// printf("%llx\n", keys[i]);
printBits(sizeof(KEY), &keys[i]);
// if(keys[i] == keysCheck[i]){
// printf("Key at %d is the correct.\n", i);
// } else {
// printf("Key at %d is the incorrect.\n", i);
// }
}
return 0;
}