| 362 | } |
| 363 | |
| 364 | int partial_hash_sha3_224(uint8_t *data_in, uint8_t *data_out) |
| 365 | { |
| 366 | sha3_context *ctx; |
| 367 | int i; |
| 368 | |
| 369 | ctx = rte_zmalloc("sha3-ctx", sizeof(sha3_context), 0); |
| 370 | if (!ctx) { |
| 371 | CCP_LOG_ERR("sha3-ctx creation failed"); |
| 372 | return -ENOMEM; |
| 373 | } |
| 374 | sha3_Init224(ctx); |
| 375 | sha3_Update(ctx, data_in, SHA3_224_BLOCK_SIZE); |
| 376 | for (i = 0; i < CCP_SHA3_CTX_SIZE; i++, data_out++) |
| 377 | *data_out = ctx->sb[CCP_SHA3_CTX_SIZE - i - 1]; |
| 378 | rte_free(ctx); |
| 379 | |
| 380 | return 0; |
| 381 | } |
| 382 | |
| 383 | int partial_hash_sha3_256(uint8_t *data_in, uint8_t *data_out) |
| 384 | { |
no test coverage detected