| 419 | } |
| 420 | |
| 421 | int partial_hash_sha3_512(uint8_t *data_in, uint8_t *data_out) |
| 422 | { |
| 423 | sha3_context *ctx; |
| 424 | int i; |
| 425 | |
| 426 | ctx = rte_zmalloc("sha3-ctx", sizeof(sha3_context), 0); |
| 427 | if (!ctx) { |
| 428 | CCP_LOG_ERR("sha3-ctx creation failed"); |
| 429 | return -ENOMEM; |
| 430 | } |
| 431 | sha3_Init512(ctx); |
| 432 | sha3_Update(ctx, data_in, SHA3_512_BLOCK_SIZE); |
| 433 | for (i = 0; i < CCP_SHA3_CTX_SIZE; i++, data_out++) |
| 434 | *data_out = ctx->sb[CCP_SHA3_CTX_SIZE - i - 1]; |
| 435 | rte_free(ctx); |
| 436 | |
| 437 | return 0; |
| 438 | } |
| 439 | |
| 440 | static int generate_partial_hash(struct ccp_session *sess) |
| 441 | { |
no test coverage detected