1
1
/*
2
- * Shared descriptors for aead, ablkcipher algorithms
2
+ * Shared descriptors for aead, skcipher algorithms
3
3
*
4
- * Copyright 2016 NXP
4
+ * Copyright 2016-2018 NXP
5
5
*/
6
6
7
7
#include "compat.h"
@@ -1212,11 +1212,8 @@ void cnstr_shdsc_rfc4543_decap(u32 * const desc, struct alginfo *cdata,
1212
1212
}
1213
1213
EXPORT_SYMBOL (cnstr_shdsc_rfc4543_decap );
1214
1214
1215
- /*
1216
- * For ablkcipher encrypt and decrypt, read from req->src and
1217
- * write to req->dst
1218
- */
1219
- static inline void ablkcipher_append_src_dst (u32 * desc )
1215
+ /* For skcipher encrypt and decrypt, read from req->src and write to req->dst */
1216
+ static inline void skcipher_append_src_dst (u32 * desc )
1220
1217
{
1221
1218
append_math_add (desc , VARSEQOUTLEN , SEQINLEN , REG0 , CAAM_CMD_SZ );
1222
1219
append_math_add (desc , VARSEQINLEN , SEQINLEN , REG0 , CAAM_CMD_SZ );
@@ -1226,7 +1223,7 @@ static inline void ablkcipher_append_src_dst(u32 *desc)
1226
1223
}
1227
1224
1228
1225
/**
1229
- * cnstr_shdsc_ablkcipher_encap - ablkcipher encapsulation shared descriptor
1226
+ * cnstr_shdsc_skcipher_encap - skcipher encapsulation shared descriptor
1230
1227
* @desc: pointer to buffer used for descriptor construction
1231
1228
* @cdata: pointer to block cipher transform definitions
1232
1229
* Valid algorithm values - one of OP_ALG_ALGSEL_{AES, DES, 3DES} ANDed
@@ -1235,9 +1232,9 @@ static inline void ablkcipher_append_src_dst(u32 *desc)
1235
1232
* @is_rfc3686: true when ctr(aes) is wrapped by rfc3686 template
1236
1233
* @ctx1_iv_off: IV offset in CONTEXT1 register
1237
1234
*/
1238
- void cnstr_shdsc_ablkcipher_encap (u32 * const desc , struct alginfo * cdata ,
1239
- unsigned int ivsize , const bool is_rfc3686 ,
1240
- const u32 ctx1_iv_off )
1235
+ void cnstr_shdsc_skcipher_encap (u32 * const desc , struct alginfo * cdata ,
1236
+ unsigned int ivsize , const bool is_rfc3686 ,
1237
+ const u32 ctx1_iv_off )
1241
1238
{
1242
1239
u32 * key_jump_cmd ;
1243
1240
@@ -1280,18 +1277,18 @@ void cnstr_shdsc_ablkcipher_encap(u32 * const desc, struct alginfo *cdata,
1280
1277
OP_ALG_ENCRYPT );
1281
1278
1282
1279
/* Perform operation */
1283
- ablkcipher_append_src_dst (desc );
1280
+ skcipher_append_src_dst (desc );
1284
1281
1285
1282
#ifdef DEBUG
1286
1283
print_hex_dump (KERN_ERR ,
1287
- "ablkcipher enc shdesc@" __stringify (__LINE__ )": " ,
1284
+ "skcipher enc shdesc@" __stringify (__LINE__ )": " ,
1288
1285
DUMP_PREFIX_ADDRESS , 16 , 4 , desc , desc_bytes (desc ), 1 );
1289
1286
#endif
1290
1287
}
1291
- EXPORT_SYMBOL (cnstr_shdsc_ablkcipher_encap );
1288
+ EXPORT_SYMBOL (cnstr_shdsc_skcipher_encap );
1292
1289
1293
1290
/**
1294
- * cnstr_shdsc_ablkcipher_decap - ablkcipher decapsulation shared descriptor
1291
+ * cnstr_shdsc_skcipher_decap - skcipher decapsulation shared descriptor
1295
1292
* @desc: pointer to buffer used for descriptor construction
1296
1293
* @cdata: pointer to block cipher transform definitions
1297
1294
* Valid algorithm values - one of OP_ALG_ALGSEL_{AES, DES, 3DES} ANDed
@@ -1300,9 +1297,9 @@ EXPORT_SYMBOL(cnstr_shdsc_ablkcipher_encap);
1300
1297
* @is_rfc3686: true when ctr(aes) is wrapped by rfc3686 template
1301
1298
* @ctx1_iv_off: IV offset in CONTEXT1 register
1302
1299
*/
1303
- void cnstr_shdsc_ablkcipher_decap (u32 * const desc , struct alginfo * cdata ,
1304
- unsigned int ivsize , const bool is_rfc3686 ,
1305
- const u32 ctx1_iv_off )
1300
+ void cnstr_shdsc_skcipher_decap (u32 * const desc , struct alginfo * cdata ,
1301
+ unsigned int ivsize , const bool is_rfc3686 ,
1302
+ const u32 ctx1_iv_off )
1306
1303
{
1307
1304
u32 * key_jump_cmd ;
1308
1305
@@ -1348,24 +1345,23 @@ void cnstr_shdsc_ablkcipher_decap(u32 * const desc, struct alginfo *cdata,
1348
1345
append_dec_op1 (desc , cdata -> algtype );
1349
1346
1350
1347
/* Perform operation */
1351
- ablkcipher_append_src_dst (desc );
1348
+ skcipher_append_src_dst (desc );
1352
1349
1353
1350
#ifdef DEBUG
1354
1351
print_hex_dump (KERN_ERR ,
1355
- "ablkcipher dec shdesc@" __stringify (__LINE__ )": " ,
1352
+ "skcipher dec shdesc@" __stringify (__LINE__ )": " ,
1356
1353
DUMP_PREFIX_ADDRESS , 16 , 4 , desc , desc_bytes (desc ), 1 );
1357
1354
#endif
1358
1355
}
1359
- EXPORT_SYMBOL (cnstr_shdsc_ablkcipher_decap );
1356
+ EXPORT_SYMBOL (cnstr_shdsc_skcipher_decap );
1360
1357
1361
1358
/**
1362
- * cnstr_shdsc_xts_ablkcipher_encap - xts ablkcipher encapsulation shared
1363
- * descriptor
1359
+ * cnstr_shdsc_xts_skcipher_encap - xts skcipher encapsulation shared descriptor
1364
1360
* @desc: pointer to buffer used for descriptor construction
1365
1361
* @cdata: pointer to block cipher transform definitions
1366
1362
* Valid algorithm values - OP_ALG_ALGSEL_AES ANDed with OP_ALG_AAI_XTS.
1367
1363
*/
1368
- void cnstr_shdsc_xts_ablkcipher_encap (u32 * const desc , struct alginfo * cdata )
1364
+ void cnstr_shdsc_xts_skcipher_encap (u32 * const desc , struct alginfo * cdata )
1369
1365
{
1370
1366
__be64 sector_size = cpu_to_be64 (512 );
1371
1367
u32 * key_jump_cmd ;
@@ -1400,24 +1396,23 @@ void cnstr_shdsc_xts_ablkcipher_encap(u32 * const desc, struct alginfo *cdata)
1400
1396
OP_ALG_ENCRYPT );
1401
1397
1402
1398
/* Perform operation */
1403
- ablkcipher_append_src_dst (desc );
1399
+ skcipher_append_src_dst (desc );
1404
1400
1405
1401
#ifdef DEBUG
1406
1402
print_hex_dump (KERN_ERR ,
1407
- "xts ablkcipher enc shdesc@" __stringify (__LINE__ ) ": " ,
1403
+ "xts skcipher enc shdesc@" __stringify (__LINE__ ) ": " ,
1408
1404
DUMP_PREFIX_ADDRESS , 16 , 4 , desc , desc_bytes (desc ), 1 );
1409
1405
#endif
1410
1406
}
1411
- EXPORT_SYMBOL (cnstr_shdsc_xts_ablkcipher_encap );
1407
+ EXPORT_SYMBOL (cnstr_shdsc_xts_skcipher_encap );
1412
1408
1413
1409
/**
1414
- * cnstr_shdsc_xts_ablkcipher_decap - xts ablkcipher decapsulation shared
1415
- * descriptor
1410
+ * cnstr_shdsc_xts_skcipher_decap - xts skcipher decapsulation shared descriptor
1416
1411
* @desc: pointer to buffer used for descriptor construction
1417
1412
* @cdata: pointer to block cipher transform definitions
1418
1413
* Valid algorithm values - OP_ALG_ALGSEL_AES ANDed with OP_ALG_AAI_XTS.
1419
1414
*/
1420
- void cnstr_shdsc_xts_ablkcipher_decap (u32 * const desc , struct alginfo * cdata )
1415
+ void cnstr_shdsc_xts_skcipher_decap (u32 * const desc , struct alginfo * cdata )
1421
1416
{
1422
1417
__be64 sector_size = cpu_to_be64 (512 );
1423
1418
u32 * key_jump_cmd ;
@@ -1451,15 +1446,15 @@ void cnstr_shdsc_xts_ablkcipher_decap(u32 * const desc, struct alginfo *cdata)
1451
1446
append_dec_op1 (desc , cdata -> algtype );
1452
1447
1453
1448
/* Perform operation */
1454
- ablkcipher_append_src_dst (desc );
1449
+ skcipher_append_src_dst (desc );
1455
1450
1456
1451
#ifdef DEBUG
1457
1452
print_hex_dump (KERN_ERR ,
1458
- "xts ablkcipher dec shdesc@" __stringify (__LINE__ ) ": " ,
1453
+ "xts skcipher dec shdesc@" __stringify (__LINE__ ) ": " ,
1459
1454
DUMP_PREFIX_ADDRESS , 16 , 4 , desc , desc_bytes (desc ), 1 );
1460
1455
#endif
1461
1456
}
1462
- EXPORT_SYMBOL (cnstr_shdsc_xts_ablkcipher_decap );
1457
+ EXPORT_SYMBOL (cnstr_shdsc_xts_skcipher_decap );
1463
1458
1464
1459
MODULE_LICENSE ("GPL" );
1465
1460
MODULE_DESCRIPTION ("FSL CAAM descriptor support" );
0 commit comments