Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a function with the header void chacha20_block_sse(chacha20_ctx *ctx, uint32_t output[16]) that behaves exactly like the function chacha20_block but uses SSE instructions to accelerate the
Write a function with the header void chacha20_block_sse(chacha20_ctx *ctx, uint32_t output[16]) that behaves exactly like the function chacha20_block but uses SSE instructions to accelerate the rounds. The file you submit should be named exactly hw2_chacha.c and should not include a main function. The chacha20_block function is shown below.
To be eligible for credit programs must report no warnings when compiled with gcc -std=c99 -W
void chacha20_block (chacha20_ctx *ctx, uint32_t output [16]) uint 32t *cons t nonce = ctx->schedule+12; //12 is where the 128 bit counter is - int i = 10; memcpy (output, ctx->schedule, sizeof (ctx->schedule)): while (i-- QUARTERROUND (output, 0, 4,8, 12) QUARTERROUND (output, 1, 5, 9, 13) QUARTERROUND (output, 2, 6, 10, 14) QUARTERROUND (output, 3, 7, 11, 15) QUARTERROUND (output, 0, 5, 10, 15) QUARTERROUND (output, 1, 6, 11, 12) QUARTERROUND (output, 2, 7, 8, 131) QUARTERROUND (output, 3, 4, 9, 14) for (i = 0; i schedule[il; FROMLE ((uint8_t *) (output+i), result); void chacha20_block (chacha20_ctx *ctx, uint32_t output [16]) uint 32t *cons t nonce = ctx->schedule+12; //12 is where the 128 bit counter is - int i = 10; memcpy (output, ctx->schedule, sizeof (ctx->schedule)): while (i-- QUARTERROUND (output, 0, 4,8, 12) QUARTERROUND (output, 1, 5, 9, 13) QUARTERROUND (output, 2, 6, 10, 14) QUARTERROUND (output, 3, 7, 11, 15) QUARTERROUND (output, 0, 5, 10, 15) QUARTERROUND (output, 1, 6, 11, 12) QUARTERROUND (output, 2, 7, 8, 131) QUARTERROUND (output, 3, 4, 9, 14) for (i = 0; i schedule[il; FROMLE ((uint8_t *) (output+i), result)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started