staticnested.c: translate comments, fix typo

This commit is contained in:
Philippe Teuwen
2023-09-19 22:09:15 +02:00
parent ebb77dc938
commit cd73ac89ee
+11 -12
View File
@@ -14,20 +14,20 @@ int main(int argc, char *const argv[]) {
uint8_t type = (uint8_t)atoui(argv[2]); // target key type
// process all args.
bool check_st_level_at_sirst_run = false;
bool check_st_level_at_first_run = false;
for (i = 3, j = 0; i < argc; i += 2) {
// nt + par
nt1 = atoui(argv[i]);
nt2 = atoui(argv[i + 1]);
// Which generation of ST tags is detected.
if (!check_st_level_at_sirst_run) {
// Which generation of static tag is detected.
if (!check_st_level_at_first_run) {
if (nt1 == 0x01200145) {
// 发现一代无漏洞,此标签全卡可用默认160的参数进行解密!
// There is no loophole in this generation.
// This tag can be decrypted with the default parameter value 160!
dist = 160; // st gen1
}
else if (nt1 == 0x009080A2) { // st gen2
// 发现无漏洞二代,我们如果确认目前需要攻击的时B密钥,那么就需要更换攻击参数
} else if (nt1 == 0x009080A2) { // st gen2
// We found that the gen2 tag is vulnerable too but parameter must be adapted depending on the attacked key
if (type == 0x61) {
dist = 161;
}
@@ -35,15 +35,14 @@ int main(int argc, char *const argv[]) {
dist = 160;
}
else {
// can't to here!!!
// can't be here!!!
goto error;
}
}
else {
// can't to here!!!
} else {
// can't be here!!!
goto error;
}
check_st_level_at_sirst_run = true;
check_st_level_at_first_run = true;
}
nttest = prng_successor(nt1, dist);