Blob
1 #include <u.h>2 #include <libc.h>3 #include <venti.h>4 #include <libsec.h>6 void7 vtsha1(uchar score[VtScoreSize], uchar *p, int n)8 {9 DigestState ds;11 memset(&ds, 0, sizeof ds);12 sha1(p, n, score, &ds);13 }15 int16 vtsha1check(uchar score[VtScoreSize], uchar *p, int n)17 {18 DigestState ds;19 uchar score2[VtScoreSize];21 memset(&ds, 0, sizeof ds);22 sha1(p, n, score2, &ds);23 if(memcmp(score, score2, VtScoreSize) != 0) {24 werrstr("vtsha1check failed");25 return -1;26 }27 return 0;28 }