@@ -979,7 +979,7 @@ void diff_BB(u64 leftDiff, u64 rightDiff, int round, double prob) {
979
979
out_diffs[diff] += prob;
980
980
if (out_diffs[diff] > best_prob) {
981
981
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));
983
983
best_outdiff = diff;
984
984
}
985
985
return ;
@@ -1088,16 +1088,7 @@ void test_H() {
1088
1088
}
1089
1089
}
1090
1090
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 () {
1101
1092
std::pair<u64,u64> beta;
1102
1093
for (std::map<std::pair<u64,u64>, std::map<int , u64>>::iterator it = prob_counts.begin (); it != prob_counts.end (); ++it) {
1103
1094
beta = it->first ;
@@ -1112,11 +1103,15 @@ int main() {
1112
1103
printf (" \n " );
1113
1104
}
1114
1105
}
1106
+ }
1107
+
1108
+ int main () {
1109
+ rng.seed (time (NULL )); // seed marsenne twister rng
1110
+
1111
+ diff_BB (0x0001 , 0x0000 , 0 , 1.0 );
1115
1112
1116
1113
// test_differential(0x0001, 0x0000, 0x1501, 0x0404, 6);
1117
1114
// diff_attack (0x0001, 0x0000, 0x0201, 0x0100, 13);
1118
-
1119
- // printf("== SIMON %d/%d ==\n\n", 2*BLOCK_SIZE, KEY_WORDS*BLOCK_SIZE);
1120
1115
1121
1116
// std::string a(BLOCK_SIZE, '0'); //a[BLOCK_SIZE-1] = '1';
1122
1117
// std::string b(BLOCK_SIZE, '0'); b[BLOCK_SIZE-8] = '1';
@@ -1143,5 +1138,6 @@ int main() {
1143
1138
// test_rotational();
1144
1139
// run_test_vectors();
1145
1140
// test_enc();
1141
+
1146
1142
return 0 ;
1147
1143
}
0 commit comments