| 400 | } |
| 401 | |
| 402 | int partial_hash_sha3_384(uint8_t *data_in, uint8_t *data_out) |
| 403 | { |
| 404 | sha3_context *ctx; |
| 405 | int i; |
| 406 | |
| 407 | ctx = rte_zmalloc("sha3-ctx", sizeof(sha3_context), 0); |
| 408 | if (!ctx) { |
| 409 | CCP_LOG_ERR("sha3-ctx creation failed"); |
| 410 | return -ENOMEM; |
| 411 | } |
| 412 | sha3_Init384(ctx); |
| 413 | sha3_Update(ctx, data_in, SHA3_384_BLOCK_SIZE); |
| 414 | for (i = 0; i < CCP_SHA3_CTX_SIZE; i++, data_out++) |
| 415 | *data_out = ctx->sb[CCP_SHA3_CTX_SIZE - i - 1]; |
| 416 | rte_free(ctx); |
| 417 | |
| 418 | return 0; |
| 419 | } |
| 420 | |
| 421 | int partial_hash_sha3_512(uint8_t *data_in, uint8_t *data_out) |
| 422 | { |
no test coverage detected