MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ccp_auth_slot

Function ccp_auth_slot

dpdk/drivers/crypto/ccp/ccp_crypto.c:1260–1332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1258}
1259
1260static inline int
1261ccp_auth_slot(struct ccp_session *session)
1262{
1263 int count = 0;
1264
1265 switch (session->auth.algo) {
1266 case CCP_AUTH_ALGO_SHA1:
1267 case CCP_AUTH_ALGO_SHA224:
1268 case CCP_AUTH_ALGO_SHA256:
1269 case CCP_AUTH_ALGO_SHA384:
1270 case CCP_AUTH_ALGO_SHA512:
1271 count = 3;
1272 /**< op + lsb passthrough cpy to/from*/
1273 break;
1274 case CCP_AUTH_ALGO_MD5_HMAC:
1275 break;
1276 case CCP_AUTH_ALGO_SHA1_HMAC:
1277 case CCP_AUTH_ALGO_SHA224_HMAC:
1278 case CCP_AUTH_ALGO_SHA256_HMAC:
1279 if (session->auth_opt == 0)
1280 count = 6;
1281 break;
1282 case CCP_AUTH_ALGO_SHA384_HMAC:
1283 case CCP_AUTH_ALGO_SHA512_HMAC:
1284 /**
1285 * 1. Load PHash1 = H(k ^ ipad); to LSB
1286 * 2. generate IHash = H(hash on message with PHash1
1287 * as init values);
1288 * 3. Retrieve IHash 2 slots for 384/512
1289 * 4. Load Phash2 = H(k ^ opad); to LSB
1290 * 5. generate FHash = H(hash on Ihash with Phash2
1291 * as init value);
1292 * 6. Retrieve HMAC output from LSB to host memory
1293 */
1294 if (session->auth_opt == 0)
1295 count = 7;
1296 break;
1297 case CCP_AUTH_ALGO_SHA3_224:
1298 case CCP_AUTH_ALGO_SHA3_256:
1299 case CCP_AUTH_ALGO_SHA3_384:
1300 case CCP_AUTH_ALGO_SHA3_512:
1301 count = 1;
1302 /**< only op ctx and dst in host memory*/
1303 break;
1304 case CCP_AUTH_ALGO_SHA3_224_HMAC:
1305 case CCP_AUTH_ALGO_SHA3_256_HMAC:
1306 count = 3;
1307 break;
1308 case CCP_AUTH_ALGO_SHA3_384_HMAC:
1309 case CCP_AUTH_ALGO_SHA3_512_HMAC:
1310 count = 4;
1311 /**
1312 * 1. Op to Perform Ihash
1313 * 2. Retrieve result from LSB to host memory
1314 * 3. Perform final hash
1315 */
1316 break;
1317 case CCP_AUTH_ALGO_AES_CMAC:

Callers 1

ccp_compute_slot_countFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected