I am currently working on a project that will eventually implement a hmac-sha1 system. Right now I am fairly close to the beginning of the project, so I am just working on getting my sha1 function to play nice with one another. The one I am currently having issues with is calling the function that handles the sha1 iterations.
So I have a function that takes in an unsigned char array, and the state variables for sha1, it then, in a for loop, will send the char array(converted to 16 byte unsigned integer array) to the interation function a total of 80 times.
void sha1Block( unsigned char data[ 64 ], SHA1State *state )
for (int i = 0; i < 80; i++) {
sha1Iteration(*((unsigned int *)data), &a, &b, &c, &d, &e, i); // This is my issue
}
Unfortunately, in my class, we never discussed how to convert char arrays into integer arrays, so trying to convert an unsigned char array of 64 characters to 16 unsigned integers is causing me many issues.
This is the iteration function that is being called:
void sha1Iteration( unsigned int data[ 16 ], unsigned int *a, unsigned int *b,
unsigned int *c, unsigned int *d, unsigned int *e, int i )
I have managed, so far, to get everything is this function more or less working to the point it is not throwing errors, so I really just need some assistance figuring out how to convert the array of 64 unsigned characters to an array of 16 unsigned integers