зеркало из https://github.com/mozilla/pjs.git
self-testing for AES
This commit is contained in:
Родитель
d50f6bafb1
Коммит
3a1d296305
|
@ -1635,12 +1635,14 @@ get_params(PRArenaPool *arena, bltestParams *params,
|
|||
case bltestDES_CBC:
|
||||
case bltestDES_EDE_CBC:
|
||||
case bltestRC2_CBC:
|
||||
case bltestAES_CBC:
|
||||
sprintf(filename, "%s/tests/%s/%s%d", testdir, modestr, "iv", j);
|
||||
load_file_data(arena, ¶ms->sk.iv, filename, bltestBinary);
|
||||
case bltestDES_ECB:
|
||||
case bltestDES_EDE_ECB:
|
||||
case bltestRC2_ECB:
|
||||
case bltestRC4:
|
||||
case bltestAES_ECB:
|
||||
sprintf(filename, "%s/tests/%s/%s%d", testdir, modestr, "key", j);
|
||||
load_file_data(arena, ¶ms->sk.key, filename, bltestBinary);
|
||||
break;
|
||||
|
@ -1991,6 +1993,7 @@ enum {
|
|||
opt_SeedFile,
|
||||
opt_InputOffset,
|
||||
opt_OutputOffset,
|
||||
opt_MonteCarlo,
|
||||
opt_CmdLine
|
||||
};
|
||||
|
||||
|
@ -2036,6 +2039,7 @@ static secuCommandFlag bltest_options[] =
|
|||
{ /* opt_SeedFile */ 'z', PR_FALSE, 0, PR_FALSE },
|
||||
{ /* opt_InputOffset */ '1', PR_TRUE, 0, PR_FALSE },
|
||||
{ /* opt_OutputOffset */ '2', PR_TRUE, 0, PR_FALSE },
|
||||
{ /* opt_MonteCarlo */ '3', PR_FALSE, 0, PR_FALSE },
|
||||
{ /* opt_CmdLine */ '-', PR_FALSE, 0, PR_FALSE }
|
||||
};
|
||||
|
||||
|
@ -2332,7 +2336,17 @@ int main(int argc, char **argv)
|
|||
misalignBuffer(cipherInfo.arena, &cipherInfo.output, outoff);
|
||||
|
||||
if (!bltest.commands[cmd_Nonce].activated) {
|
||||
cipherDoOp(&cipherInfo);
|
||||
if (bltest.options[opt_MonteCarlo].activated) {
|
||||
int mciter;
|
||||
for (mciter=0; mciter<10000; mciter++) {
|
||||
cipherDoOp(&cipherInfo);
|
||||
memcpy(cipherInfo.input.buf.data,
|
||||
cipherInfo.output.buf.data,
|
||||
cipherInfo.input.buf.len);
|
||||
}
|
||||
} else {
|
||||
cipherDoOp(&cipherInfo);
|
||||
}
|
||||
cipherFinish(&cipherInfo);
|
||||
finishIO(&cipherInfo.output, outfile);
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
oJLgOzZ1GiWt3DGo2sPKaA==
|
|
@ -0,0 +1 @@
|
|||
qwertyuiopasdfgh
|
|
@ -0,0 +1 @@
|
|||
fedcba9876543210
|
|
@ -1 +1 @@
|
|||
0
|
||||
1
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
0123456789abcdef
|
|
@ -0,0 +1 @@
|
|||
PVuaCIiaKQhblgFCbVMTTg==
|
|
@ -0,0 +1 @@
|
|||
fedcba9876543210
|
|
@ -1 +1 @@
|
|||
0
|
||||
1
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
0123456789abcdef
|
Загрузка…
Ссылка в новой задаче