- printf( "\nTest %d: %d, '%s'\n",
- j+1,
- repeatcount[j],
- testarray[j]);
-
- err = SHA1Init(&sha);
- if (err) {
- fprintf(stderr, "SHA1Reset Error %d.\n", err );
- break; /* out of for j loop */
- }
-
- for(i = 0; i < repeatcount[j]; ++i) {
-
- err = SHA1Input(&sha,
- (const unsigned char *) testarray[j],
- strlen(testarray[j]));
- if (err) {
- fprintf(stderr, "SHA1Input Error %d.\n", err );
- break; /* out of for i loop */
- }
- }
-
- err = SHA1Final(&sha, Message_Digest);
- if (err) {
- fprintf(stderr,
- "SHA1Result Error %d, could not compute message digest.\n",
- err );
- }
- else
- {
- printf("\t");
- for(i = 0; i < 20 ; ++i) {
- printf("%02X ", Message_Digest[i]);
- }
- printf("\n");
- }
- printf("Should match:\n");
- printf("\t%s\n", resultarray[j]);
+ printf( "\nTest %d: %d, '%s'\n",
+ j+1,
+ repeatcount[j],
+ testarray[j]);
+
+ err = SHA1Init(&sha);
+ if (err) {
+ fprintf(stderr, "SHA1Reset Error %d.\n", err );
+ break; /* out of for j loop */
+ }
+
+ for(i = 0; i < repeatcount[j]; ++i) {
+
+ err = SHA1Input(&sha,
+ (const unsigned char *) testarray[j],
+ strlen(testarray[j]));
+ if (err) {
+ fprintf(stderr, "SHA1Input Error %d.\n", err );
+ break; /* out of for i loop */
+ }
+ }
+
+ err = SHA1Final(&sha, Message_Digest);
+ if (err) {
+ fprintf(stderr,
+ "SHA1Result Error %d, could not compute message digest.\n",
+ err );
+ }
+ else
+ {
+ printf("\t");
+ for(i = 0; i < 20 ; ++i) {
+ printf("%02X ", Message_Digest[i]);
+ }
+ printf("\n");
+ }
+ printf("Should match:\n");
+ printf("\t%s\n", resultarray[j]);