wycheproof_aead: divide by 8 at parse time
This commit is contained in:
parent
7bc527c769
commit
eedaa46831
@ -201,6 +201,7 @@ main(int argc, char *argv[])
|
|||||||
ivlenarg = strtonum(optarg, 0, LLONG_MAX, &errstr);
|
ivlenarg = strtonum(optarg, 0, LLONG_MAX, &errstr);
|
||||||
if (errstr != NULL)
|
if (errstr != NULL)
|
||||||
errx(1, "ivlen is %s: %s", errstr, optarg);
|
errx(1, "ivlen is %s: %s", errstr, optarg);
|
||||||
|
ivlenarg /= 8;
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
iflag = 1;
|
iflag = 1;
|
||||||
@ -221,6 +222,7 @@ main(int argc, char *argv[])
|
|||||||
errx(1, "keylen is %s: %s", errstr, optarg);
|
errx(1, "keylen is %s: %s", errstr, optarg);
|
||||||
if (keylenarg % 8 != 0)
|
if (keylenarg % 8 != 0)
|
||||||
errx(1, "unsupport K value: %zu", keylenarg);
|
errx(1, "unsupport K value: %zu", keylenarg);
|
||||||
|
keylenarg /= 8;
|
||||||
break;
|
break;
|
||||||
case 'k':
|
case 'k':
|
||||||
kflag = 1;
|
kflag = 1;
|
||||||
@ -251,6 +253,7 @@ main(int argc, char *argv[])
|
|||||||
taglenarg = strtonum(optarg, 0, LLONG_MAX, &errstr);
|
taglenarg = strtonum(optarg, 0, LLONG_MAX, &errstr);
|
||||||
if (errstr != NULL)
|
if (errstr != NULL)
|
||||||
errx(1, "taglen is %s: %s", errstr, optarg);
|
errx(1, "taglen is %s: %s", errstr, optarg);
|
||||||
|
taglenarg /= 8;
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
tflag = 1;
|
tflag = 1;
|
||||||
@ -282,10 +285,6 @@ main(int argc, char *argv[])
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ivlenarg /= 8;
|
|
||||||
keylenarg /= 8;
|
|
||||||
taglenarg /= 8;
|
|
||||||
|
|
||||||
out = malloc(outlen);
|
out = malloc(outlen);
|
||||||
if (out == NULL)
|
if (out == NULL)
|
||||||
err(1, "out of memory");
|
err(1, "out of memory");
|
||||||
|
Loading…
Reference in New Issue
Block a user