6 static void encode(uchar*, u32int*, ulong);
7 extern void vtSha1Block(u32int *s, uchar *p, ulong len);
19 s = vtMemAlloc(sizeof(VtSha1));
41 vtSha1Update(VtSha1 *s, uchar *p, int len)
43 s->s = sha1(p, len, nil, s->s);
47 vtSha1Final(VtSha1 *s, uchar *digest)
49 sha1(nil, 0, digest, s->s);
54 vtSha1(uchar sha1[VtScoreSize], uchar *p, int n)
59 vtSha1Update(&s, p, n);
60 vtSha1Final(&s, sha1);
64 vtSha1Check(uchar score[VtScoreSize], uchar *p, int n)
67 uchar score2[VtScoreSize];
70 vtSha1Update(&s, p, n);
71 vtSha1Final(&s, score2);
73 if(memcmp(score, score2, VtScoreSize) != 0) {
74 vtSetError("vtSha1Check failed");