Skip to content

Commit 7a2d0b5

Browse files
author
Martin M. Lauridsen
committed
clean up a bit
1 parent da52f31 commit 7a2d0b5

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

simon.cpp

+9-13
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ void diff_BB(u64 leftDiff, u64 rightDiff, int round, double prob) {
979979
out_diffs[diff] += prob;
980980
if (out_diffs[diff] > best_prob) {
981981
best_prob = out_diffs[diff];
982-
//printf("New best %016llx %016llx prob. : 2^{%f}\n", diff.first, diff.second, log2(best_prob));
982+
printf("New best %016llx %016llx prob. : 2^{%f}\n", diff.first, diff.second, log2(best_prob));
983983
best_outdiff = diff;
984984
}
985985
return;
@@ -1088,16 +1088,7 @@ void test_H() {
10881088
}
10891089
}
10901090

1091-
int main() {
1092-
rng.seed(time(NULL)); // seed marsenne twister rng
1093-
1094-
//u64 x = 0xaece; //1010 1110 1100 1110
1095-
//printf("%d\n", weight(((x^(rotate(x,7)))&x)|( rotate(x,14) )) );
1096-
1097-
//test_H();
1098-
1099-
diff_BB(0x0001, 0x0000, 0, 1.0);
1100-
1091+
void check_diff_effect() {
11011092
std::pair<u64,u64> beta;
11021093
for (std::map<std::pair<u64,u64>, std::map<int, u64>>::iterator it = prob_counts.begin(); it != prob_counts.end(); ++it) {
11031094
beta = it->first;
@@ -1112,11 +1103,15 @@ int main() {
11121103
printf("\n");
11131104
}
11141105
}
1106+
}
1107+
1108+
int main() {
1109+
rng.seed(time(NULL)); // seed marsenne twister rng
1110+
1111+
diff_BB(0x0001, 0x0000, 0, 1.0);
11151112

11161113
//test_differential(0x0001, 0x0000, 0x1501, 0x0404, 6);
11171114
//diff_attack (0x0001, 0x0000, 0x0201, 0x0100, 13);
1118-
1119-
//printf("== SIMON %d/%d ==\n\n", 2*BLOCK_SIZE, KEY_WORDS*BLOCK_SIZE);
11201115

11211116
//std::string a(BLOCK_SIZE, '0'); //a[BLOCK_SIZE-1] = '1';
11221117
//std::string b(BLOCK_SIZE, '0'); b[BLOCK_SIZE-8] = '1';
@@ -1143,5 +1138,6 @@ int main() {
11431138
//test_rotational();
11441139
//run_test_vectors();
11451140
//test_enc();
1141+
11461142
return 0;
11471143
}

0 commit comments

Comments
 (0)