Newer
Older
{
const char *algo = crypto_tfm_alg_driver_name(crypto_pcomp_tfm(tfm));
unsigned int i;
char result[COMP_BUF_SIZE];
Geert Uytterhoeven
committed
int res;
for (i = 0; i < ctcount; i++) {
struct comp_request req;
Geert Uytterhoeven
committed
unsigned int produced = 0;
Geert Uytterhoeven
committed
res = crypto_compress_setup(tfm, ctemplate[i].params,
ctemplate[i].paramsize);
if (res) {
pr_err("alg: pcomp: compression setup failed on test "
Geert Uytterhoeven
committed
"%d for %s: error=%d\n", i + 1, algo, res);
return res;
Geert Uytterhoeven
committed
res = crypto_compress_init(tfm);
if (res) {
pr_err("alg: pcomp: compression init failed on test "
Geert Uytterhoeven
committed
"%d for %s: error=%d\n", i + 1, algo, res);
return res;
}
memset(result, 0, sizeof(result));
req.next_in = ctemplate[i].input;
req.avail_in = ctemplate[i].inlen / 2;
req.next_out = result;
req.avail_out = ctemplate[i].outlen / 2;
Geert Uytterhoeven
committed
res = crypto_compress_update(tfm, &req);
if (res < 0 && (res != -EAGAIN || req.avail_in)) {
pr_err("alg: pcomp: compression update failed on test "
Geert Uytterhoeven
committed
"%d for %s: error=%d\n", i + 1, algo, res);
return res;
Geert Uytterhoeven
committed
if (res > 0)
produced += res;
/* Add remaining input data */
req.avail_in += (ctemplate[i].inlen + 1) / 2;
Geert Uytterhoeven
committed
res = crypto_compress_update(tfm, &req);
if (res < 0 && (res != -EAGAIN || req.avail_in)) {
pr_err("alg: pcomp: compression update failed on test "
Geert Uytterhoeven
committed
"%d for %s: error=%d\n", i + 1, algo, res);
return res;
Geert Uytterhoeven
committed
if (res > 0)
produced += res;
/* Provide remaining output space */
req.avail_out += COMP_BUF_SIZE - ctemplate[i].outlen / 2;
Geert Uytterhoeven
committed
res = crypto_compress_final(tfm, &req);
if (res < 0) {
pr_err("alg: pcomp: compression final failed on test "
Geert Uytterhoeven
committed
"%d for %s: error=%d\n", i + 1, algo, res);
return res;
Geert Uytterhoeven
committed
produced += res;
if (COMP_BUF_SIZE - req.avail_out != ctemplate[i].outlen) {
pr_err("alg: comp: Compression test %d failed for %s: "
"output len = %d (expected %d)\n", i + 1, algo,
COMP_BUF_SIZE - req.avail_out,
ctemplate[i].outlen);
return -EINVAL;
}
Geert Uytterhoeven
committed
if (produced != ctemplate[i].outlen) {
pr_err("alg: comp: Compression test %d failed for %s: "
"returned len = %u (expected %d)\n", i + 1,
algo, produced, ctemplate[i].outlen);
return -EINVAL;
}
if (memcmp(result, ctemplate[i].output, ctemplate[i].outlen)) {
pr_err("alg: pcomp: Compression test %d failed for "
"%s\n", i + 1, algo);
hexdump(result, ctemplate[i].outlen);
return -EINVAL;
}
}
for (i = 0; i < dtcount; i++) {
struct comp_request req;
Geert Uytterhoeven
committed
unsigned int produced = 0;
Geert Uytterhoeven
committed
res = crypto_decompress_setup(tfm, dtemplate[i].params,
dtemplate[i].paramsize);
if (res) {
pr_err("alg: pcomp: decompression setup failed on "
Geert Uytterhoeven
committed
"test %d for %s: error=%d\n", i + 1, algo, res);
return res;
Geert Uytterhoeven
committed
res = crypto_decompress_init(tfm);
if (res) {
pr_err("alg: pcomp: decompression init failed on test "
Geert Uytterhoeven
committed
"%d for %s: error=%d\n", i + 1, algo, res);
return res;
}
memset(result, 0, sizeof(result));
req.next_in = dtemplate[i].input;
req.avail_in = dtemplate[i].inlen / 2;
req.next_out = result;
req.avail_out = dtemplate[i].outlen / 2;
Geert Uytterhoeven
committed
res = crypto_decompress_update(tfm, &req);
if (res < 0 && (res != -EAGAIN || req.avail_in)) {
pr_err("alg: pcomp: decompression update failed on "
Geert Uytterhoeven
committed
"test %d for %s: error=%d\n", i + 1, algo, res);
return res;
Geert Uytterhoeven
committed
if (res > 0)
produced += res;
/* Add remaining input data */
req.avail_in += (dtemplate[i].inlen + 1) / 2;
Geert Uytterhoeven
committed
res = crypto_decompress_update(tfm, &req);
if (res < 0 && (res != -EAGAIN || req.avail_in)) {
pr_err("alg: pcomp: decompression update failed on "
Geert Uytterhoeven
committed
"test %d for %s: error=%d\n", i + 1, algo, res);
return res;
Geert Uytterhoeven
committed
if (res > 0)
produced += res;
/* Provide remaining output space */
req.avail_out += COMP_BUF_SIZE - dtemplate[i].outlen / 2;
Geert Uytterhoeven
committed
res = crypto_decompress_final(tfm, &req);
if (res < 0 && (res != -EAGAIN || req.avail_in)) {
pr_err("alg: pcomp: decompression final failed on "
Geert Uytterhoeven
committed
"test %d for %s: error=%d\n", i + 1, algo, res);
return res;
Geert Uytterhoeven
committed
if (res > 0)
produced += res;
if (COMP_BUF_SIZE - req.avail_out != dtemplate[i].outlen) {
pr_err("alg: comp: Decompression test %d failed for "
"%s: output len = %d (expected %d)\n", i + 1,
algo, COMP_BUF_SIZE - req.avail_out,
dtemplate[i].outlen);
return -EINVAL;
}
Geert Uytterhoeven
committed
if (produced != dtemplate[i].outlen) {
pr_err("alg: comp: Decompression test %d failed for "
"%s: returned len = %u (expected %d)\n", i + 1,
algo, produced, dtemplate[i].outlen);
return -EINVAL;
}
if (memcmp(result, dtemplate[i].output, dtemplate[i].outlen)) {
pr_err("alg: pcomp: Decompression test %d failed for "
"%s\n", i + 1, algo);
hexdump(result, dtemplate[i].outlen);
return -EINVAL;
}
}
return 0;
}
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
static int test_cprng(struct crypto_rng *tfm, struct cprng_testvec *template,
unsigned int tcount)
{
const char *algo = crypto_tfm_alg_driver_name(crypto_rng_tfm(tfm));
int err, i, j, seedsize;
u8 *seed;
char result[32];
seedsize = crypto_rng_seedsize(tfm);
seed = kmalloc(seedsize, GFP_KERNEL);
if (!seed) {
printk(KERN_ERR "alg: cprng: Failed to allocate seed space "
"for %s\n", algo);
return -ENOMEM;
}
for (i = 0; i < tcount; i++) {
memset(result, 0, 32);
memcpy(seed, template[i].v, template[i].vlen);
memcpy(seed + template[i].vlen, template[i].key,
template[i].klen);
memcpy(seed + template[i].vlen + template[i].klen,
template[i].dt, template[i].dtlen);
err = crypto_rng_reset(tfm, seed, seedsize);
if (err) {
printk(KERN_ERR "alg: cprng: Failed to reset rng "
"for %s\n", algo);
goto out;
}
for (j = 0; j < template[i].loops; j++) {
err = crypto_rng_get_bytes(tfm, result,
template[i].rlen);
if (err != template[i].rlen) {
printk(KERN_ERR "alg: cprng: Failed to obtain "
"the correct amount of random data for "
"%s (requested %d, got %d)\n", algo,
template[i].rlen, err);
goto out;
}
}
err = memcmp(result, template[i].result,
template[i].rlen);
if (err) {
printk(KERN_ERR "alg: cprng: Test %d failed for %s\n",
i, algo);
hexdump(result, template[i].rlen);
err = -EINVAL;
goto out;
}
}
out:
kfree(seed);
return err;
}
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
static int alg_test_aead(const struct alg_test_desc *desc, const char *driver,
u32 type, u32 mask)
{
struct crypto_aead *tfm;
int err = 0;
tfm = crypto_alloc_aead(driver, type, mask);
if (IS_ERR(tfm)) {
printk(KERN_ERR "alg: aead: Failed to load transform for %s: "
"%ld\n", driver, PTR_ERR(tfm));
return PTR_ERR(tfm);
}
if (desc->suite.aead.enc.vecs) {
err = test_aead(tfm, ENCRYPT, desc->suite.aead.enc.vecs,
desc->suite.aead.enc.count);
if (err)
goto out;
}
if (!err && desc->suite.aead.dec.vecs)
err = test_aead(tfm, DECRYPT, desc->suite.aead.dec.vecs,
desc->suite.aead.dec.count);
out:
crypto_free_aead(tfm);
return err;
}
static int alg_test_cipher(const struct alg_test_desc *desc,
const char *driver, u32 type, u32 mask)
{
tfm = crypto_alloc_cipher(driver, type, mask);
if (IS_ERR(tfm)) {
printk(KERN_ERR "alg: cipher: Failed to load transform for "
"%s: %ld\n", driver, PTR_ERR(tfm));
return PTR_ERR(tfm);
}
if (desc->suite.cipher.enc.vecs) {
err = test_cipher(tfm, ENCRYPT, desc->suite.cipher.enc.vecs,
desc->suite.cipher.enc.count);
if (err)
goto out;
}
if (desc->suite.cipher.dec.vecs)
err = test_cipher(tfm, DECRYPT, desc->suite.cipher.dec.vecs,
desc->suite.cipher.dec.count);
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
out:
crypto_free_cipher(tfm);
return err;
}
static int alg_test_skcipher(const struct alg_test_desc *desc,
const char *driver, u32 type, u32 mask)
{
struct crypto_ablkcipher *tfm;
int err = 0;
tfm = crypto_alloc_ablkcipher(driver, type, mask);
if (IS_ERR(tfm)) {
printk(KERN_ERR "alg: skcipher: Failed to load transform for "
"%s: %ld\n", driver, PTR_ERR(tfm));
return PTR_ERR(tfm);
}
if (desc->suite.cipher.enc.vecs) {
err = test_skcipher(tfm, ENCRYPT, desc->suite.cipher.enc.vecs,
desc->suite.cipher.enc.count);
if (err)
goto out;
}
if (desc->suite.cipher.dec.vecs)
err = test_skcipher(tfm, DECRYPT, desc->suite.cipher.dec.vecs,
desc->suite.cipher.dec.count);
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
out:
crypto_free_ablkcipher(tfm);
return err;
}
static int alg_test_comp(const struct alg_test_desc *desc, const char *driver,
u32 type, u32 mask)
{
struct crypto_comp *tfm;
int err;
tfm = crypto_alloc_comp(driver, type, mask);
if (IS_ERR(tfm)) {
printk(KERN_ERR "alg: comp: Failed to load transform for %s: "
"%ld\n", driver, PTR_ERR(tfm));
return PTR_ERR(tfm);
}
err = test_comp(tfm, desc->suite.comp.comp.vecs,
desc->suite.comp.decomp.vecs,
desc->suite.comp.comp.count,
desc->suite.comp.decomp.count);
crypto_free_comp(tfm);
return err;
}
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
static int alg_test_pcomp(const struct alg_test_desc *desc, const char *driver,
u32 type, u32 mask)
{
struct crypto_pcomp *tfm;
int err;
tfm = crypto_alloc_pcomp(driver, type, mask);
if (IS_ERR(tfm)) {
pr_err("alg: pcomp: Failed to load transform for %s: %ld\n",
driver, PTR_ERR(tfm));
return PTR_ERR(tfm);
}
err = test_pcomp(tfm, desc->suite.pcomp.comp.vecs,
desc->suite.pcomp.decomp.vecs,
desc->suite.pcomp.comp.count,
desc->suite.pcomp.decomp.count);
crypto_free_pcomp(tfm);
return err;
}
static int alg_test_hash(const struct alg_test_desc *desc, const char *driver,
u32 type, u32 mask)
{
struct crypto_ahash *tfm;
int err;
tfm = crypto_alloc_ahash(driver, type, mask);
if (IS_ERR(tfm)) {
printk(KERN_ERR "alg: hash: Failed to load transform for %s: "
"%ld\n", driver, PTR_ERR(tfm));
return PTR_ERR(tfm);
}
err = test_hash(tfm, desc->suite.hash.vecs, desc->suite.hash.count);
crypto_free_ahash(tfm);
return err;
}
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
static int alg_test_crc32c(const struct alg_test_desc *desc,
const char *driver, u32 type, u32 mask)
{
struct crypto_shash *tfm;
u32 val;
int err;
err = alg_test_hash(desc, driver, type, mask);
if (err)
goto out;
tfm = crypto_alloc_shash(driver, type, mask);
if (IS_ERR(tfm)) {
printk(KERN_ERR "alg: crc32c: Failed to load transform for %s: "
"%ld\n", driver, PTR_ERR(tfm));
err = PTR_ERR(tfm);
goto out;
}
do {
struct {
struct shash_desc shash;
char ctx[crypto_shash_descsize(tfm)];
} sdesc;
sdesc.shash.tfm = tfm;
sdesc.shash.flags = 0;
*(u32 *)sdesc.ctx = le32_to_cpu(420553207);
err = crypto_shash_final(&sdesc.shash, (u8 *)&val);
if (err) {
printk(KERN_ERR "alg: crc32c: Operation failed for "
"%s: %d\n", driver, err);
break;
}
if (val != ~420553207) {
printk(KERN_ERR "alg: crc32c: Test failed for %s: "
"%d\n", driver, val);
err = -EINVAL;
}
} while (0);
crypto_free_shash(tfm);
out:
return err;
}
static int alg_test_cprng(const struct alg_test_desc *desc, const char *driver,
u32 type, u32 mask)
{
struct crypto_rng *rng;
int err;
rng = crypto_alloc_rng(driver, type, mask);
if (IS_ERR(rng)) {
printk(KERN_ERR "alg: cprng: Failed to load transform for %s: "
"%ld\n", driver, PTR_ERR(rng));
return PTR_ERR(rng);
}
err = test_cprng(rng, desc->suite.cprng.vecs, desc->suite.cprng.count);
crypto_free_rng(rng);
return err;
}
/* Please keep this list sorted by algorithm name. */
static const struct alg_test_desc alg_test_descs[] = {
{
.alg = "ansi_cprng",
.test = alg_test_cprng,
.suite = {
.cprng = {
.vecs = ansi_cprng_aes_tv_template,
.count = ANSI_CPRNG_AES_TEST_VECTORS
}
}
}, {
.suite = {
.cipher = {
.enc = {
.vecs = aes_cbc_enc_tv_template,
.count = AES_CBC_ENC_TEST_VECTORS
},
.dec = {
.vecs = aes_cbc_dec_tv_template,
.count = AES_CBC_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "cbc(anubis)",
.suite = {
.cipher = {
.enc = {
.vecs = anubis_cbc_enc_tv_template,
.count = ANUBIS_CBC_ENC_TEST_VECTORS
},
.dec = {
.vecs = anubis_cbc_dec_tv_template,
.count = ANUBIS_CBC_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "cbc(blowfish)",
.suite = {
.cipher = {
.enc = {
.vecs = bf_cbc_enc_tv_template,
.count = BF_CBC_ENC_TEST_VECTORS
},
.dec = {
.vecs = bf_cbc_dec_tv_template,
.count = BF_CBC_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "cbc(camellia)",
.suite = {
.cipher = {
.enc = {
.vecs = camellia_cbc_enc_tv_template,
.count = CAMELLIA_CBC_ENC_TEST_VECTORS
},
.dec = {
.vecs = camellia_cbc_dec_tv_template,
.count = CAMELLIA_CBC_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "cbc(des)",
.suite = {
.cipher = {
.enc = {
.vecs = des_cbc_enc_tv_template,
.count = DES_CBC_ENC_TEST_VECTORS
},
.dec = {
.vecs = des_cbc_dec_tv_template,
.count = DES_CBC_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "cbc(des3_ede)",
.suite = {
.cipher = {
.enc = {
.vecs = des3_ede_cbc_enc_tv_template,
.count = DES3_EDE_CBC_ENC_TEST_VECTORS
},
.dec = {
.vecs = des3_ede_cbc_dec_tv_template,
.count = DES3_EDE_CBC_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "cbc(twofish)",
.suite = {
.cipher = {
.enc = {
.vecs = tf_cbc_enc_tv_template,
.count = TF_CBC_ENC_TEST_VECTORS
},
.dec = {
.vecs = tf_cbc_dec_tv_template,
.count = TF_CBC_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ccm(aes)",
.test = alg_test_aead,
.suite = {
.aead = {
.enc = {
.vecs = aes_ccm_enc_tv_template,
.count = AES_CCM_ENC_TEST_VECTORS
},
.dec = {
.vecs = aes_ccm_dec_tv_template,
.count = AES_CCM_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "crc32c",
.suite = {
.hash = {
.vecs = crc32c_tv_template,
.count = CRC32C_TEST_VECTORS
}
}
}, {
.alg = "ctr(aes)",
.test = alg_test_skcipher,
.suite = {
.cipher = {
.enc = {
.vecs = aes_ctr_enc_tv_template,
.count = AES_CTR_ENC_TEST_VECTORS
},
.dec = {
.vecs = aes_ctr_dec_tv_template,
.count = AES_CTR_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "cts(cbc(aes))",
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
.suite = {
.cipher = {
.enc = {
.vecs = cts_mode_enc_tv_template,
.count = CTS_MODE_ENC_TEST_VECTORS
},
.dec = {
.vecs = cts_mode_dec_tv_template,
.count = CTS_MODE_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "deflate",
.test = alg_test_comp,
.suite = {
.comp = {
.comp = {
.vecs = deflate_comp_tv_template,
.count = DEFLATE_COMP_TEST_VECTORS
},
.decomp = {
.vecs = deflate_decomp_tv_template,
.count = DEFLATE_DECOMP_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(aes)",
.suite = {
.cipher = {
.enc = {
.vecs = aes_enc_tv_template,
.count = AES_ENC_TEST_VECTORS
},
.dec = {
.vecs = aes_dec_tv_template,
.count = AES_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(anubis)",
.suite = {
.cipher = {
.enc = {
.vecs = anubis_enc_tv_template,
.count = ANUBIS_ENC_TEST_VECTORS
},
.dec = {
.vecs = anubis_dec_tv_template,
.count = ANUBIS_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(arc4)",
.suite = {
.cipher = {
.enc = {
.vecs = arc4_enc_tv_template,
.count = ARC4_ENC_TEST_VECTORS
},
.dec = {
.vecs = arc4_dec_tv_template,
.count = ARC4_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(blowfish)",
.suite = {
.cipher = {
.enc = {
.vecs = bf_enc_tv_template,
.count = BF_ENC_TEST_VECTORS
},
.dec = {
.vecs = bf_dec_tv_template,
.count = BF_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(camellia)",
.suite = {
.cipher = {
.enc = {
.vecs = camellia_enc_tv_template,
.count = CAMELLIA_ENC_TEST_VECTORS
},
.dec = {
.vecs = camellia_dec_tv_template,
.count = CAMELLIA_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(cast5)",
.suite = {
.cipher = {
.enc = {
.vecs = cast5_enc_tv_template,
.count = CAST5_ENC_TEST_VECTORS
},
.dec = {
.vecs = cast5_dec_tv_template,
.count = CAST5_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(cast6)",
.suite = {
.cipher = {
.enc = {
.vecs = cast6_enc_tv_template,
.count = CAST6_ENC_TEST_VECTORS
},
.dec = {
.vecs = cast6_dec_tv_template,
.count = CAST6_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(des)",
.suite = {
.cipher = {
.enc = {
.vecs = des_enc_tv_template,
.count = DES_ENC_TEST_VECTORS
},
.dec = {
.vecs = des_dec_tv_template,
.count = DES_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(des3_ede)",
.suite = {
.cipher = {
.enc = {
.vecs = des3_ede_enc_tv_template,
.count = DES3_EDE_ENC_TEST_VECTORS
},
.dec = {
.vecs = des3_ede_dec_tv_template,
.count = DES3_EDE_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(khazad)",
.suite = {
.cipher = {
.enc = {
.vecs = khazad_enc_tv_template,
.count = KHAZAD_ENC_TEST_VECTORS
},
.dec = {
.vecs = khazad_dec_tv_template,
.count = KHAZAD_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(seed)",
.suite = {
.cipher = {
.enc = {
.vecs = seed_enc_tv_template,
.count = SEED_ENC_TEST_VECTORS
},
.dec = {
.vecs = seed_dec_tv_template,
.count = SEED_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(serpent)",
.suite = {
.cipher = {
.enc = {
.vecs = serpent_enc_tv_template,
.count = SERPENT_ENC_TEST_VECTORS
},
.dec = {
.vecs = serpent_dec_tv_template,
.count = SERPENT_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(tea)",
.suite = {
.cipher = {
.enc = {
.vecs = tea_enc_tv_template,
.count = TEA_ENC_TEST_VECTORS
},
.dec = {
.vecs = tea_dec_tv_template,
.count = TEA_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(tnepres)",
.suite = {
.cipher = {
.enc = {
.vecs = tnepres_enc_tv_template,
.count = TNEPRES_ENC_TEST_VECTORS
},
.dec = {
.vecs = tnepres_dec_tv_template,
.count = TNEPRES_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(twofish)",
.suite = {
.cipher = {
.enc = {
.vecs = tf_enc_tv_template,
.count = TF_ENC_TEST_VECTORS
},
.dec = {
.vecs = tf_dec_tv_template,
.count = TF_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(xeta)",
.suite = {
.cipher = {
.enc = {
.vecs = xeta_enc_tv_template,
.count = XETA_ENC_TEST_VECTORS
},
.dec = {
.vecs = xeta_dec_tv_template,
.count = XETA_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "ecb(xtea)",
.suite = {
.cipher = {
.enc = {
.vecs = xtea_enc_tv_template,
.count = XTEA_ENC_TEST_VECTORS
},
.dec = {
.vecs = xtea_dec_tv_template,
.count = XTEA_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "gcm(aes)",
.test = alg_test_aead,
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
.suite = {
.aead = {
.enc = {
.vecs = aes_gcm_enc_tv_template,
.count = AES_GCM_ENC_TEST_VECTORS
},
.dec = {
.vecs = aes_gcm_dec_tv_template,
.count = AES_GCM_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "hmac(md5)",
.test = alg_test_hash,
.suite = {
.hash = {
.vecs = hmac_md5_tv_template,
.count = HMAC_MD5_TEST_VECTORS
}
}
}, {
.alg = "hmac(rmd128)",
.test = alg_test_hash,
.suite = {
.hash = {
.vecs = hmac_rmd128_tv_template,
.count = HMAC_RMD128_TEST_VECTORS
}
}
}, {
.alg = "hmac(rmd160)",
.test = alg_test_hash,
.suite = {
.hash = {
.vecs = hmac_rmd160_tv_template,
.count = HMAC_RMD160_TEST_VECTORS
}
}
}, {
.alg = "hmac(sha1)",
.test = alg_test_hash,
.suite = {
.hash = {
.vecs = hmac_sha1_tv_template,
.count = HMAC_SHA1_TEST_VECTORS
}
}
}, {
.alg = "hmac(sha224)",
.test = alg_test_hash,
.suite = {
.hash = {
.vecs = hmac_sha224_tv_template,
.count = HMAC_SHA224_TEST_VECTORS
}
}
}, {
.alg = "hmac(sha256)",
.test = alg_test_hash,
.suite = {
.hash = {
.vecs = hmac_sha256_tv_template,
.count = HMAC_SHA256_TEST_VECTORS
}
}
}, {
.alg = "hmac(sha384)",
.test = alg_test_hash,
.suite = {
.hash = {
.vecs = hmac_sha384_tv_template,
.count = HMAC_SHA384_TEST_VECTORS
}
}
}, {
.alg = "hmac(sha512)",
.test = alg_test_hash,
.suite = {
.hash = {
.vecs = hmac_sha512_tv_template,
.count = HMAC_SHA512_TEST_VECTORS
}
}
}, {
.alg = "lrw(aes)",