#include "../lib/lib.h" #include "../lib/lib2.h" #include "../lib/lib3.h" #include "../lib/lib4.h" #include int main() { unsigned int hex[5]; int i; char text[] = "Rolling on the floor lauthing"; char *key = "ROFL"; sha1_hmac(hex, text, strlen(text), key, strlen(key)); for(i=0; i<5; i++) { printf("%08x", hex[i]); } printf("\n"); if(sha1_hmac_verify(hex, text, strlen(text), key, strlen(key))) printf("MACs are equal\n"); // tamper message change R to r text[0] = 'r'; if(!sha1_hmac_verify(hex, text, strlen(text), key, strlen(key))) printf("MACs of tampered message are NOT equal\n"); }