added validation against the rfc test vector data
@@ -43,6 +43,11 @@ main(
"0102030405060708090a0b0c0d0e0f00",
"deadbeefdeadbeefdeadbeefdeadbeef",
"feed0feed1feed2feed3feed4feed5ab"};
+ char *expected_sums[4] = {
+ "000f4479bd317381",
+ "000f433686466a62",
+ "000f416c8884d2d3",
+ "000f3f0b4b416ec8"};
unsigned int nice[] = {1,10,100,1000,100000,1000000};
unsigned int i,j,n;
OWPExpContext exp;
@@ -100,6 +105,17 @@ main(
}
OWPExpContextFree(exp);
exp = NULL;
+
+ char sum_hex[17];
+ sprintf(sum_hex, "%016" PRIx64, sum);
+ fprintf(stdout,
+ "FINAL SUM[%d]: 0x%s, EXPECTED_SUM[%d]: 0x%s\n",
+ i, sum_hex, i, expected_sums[i]);
+ if(strcmp(sum_hex, expected_sums[i])) {
+ fprintf(stdout, "sum validation error");
+ exit(1);
+ }
+
fprintf(stdout,"\n");
}
