projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hashing macros for strings and integers.
[u/mdw/catacomb]
/
catcrypt.c
diff --git
a/catcrypt.c
b/catcrypt.c
index
4e54712
..
967730a
100644
(file)
--- a/
catcrypt.c
+++ b/
catcrypt.c
@@
-276,8
+276,7
@@
static int encrypt(int argc, char *argv[])
seq = 0;
for (;;) {
h = GM_INIT(m);
seq = 0;
for (;;) {
h = GM_INIT(m);
- STORE32(bb, seq);
- GH_HASH(h, bb, 4);
+ GH_HASHU32(h, seq);
seq++;
if (GC_CLASS(c)->blksz) {
GC_ENCRYPT(cx, 0, bb, GC_CLASS(c)->blksz);
seq++;
if (GC_CLASS(c)->blksz) {
GC_ENCRYPT(cx, 0, bb, GC_CLASS(c)->blksz);
@@
-487,8
+486,7
@@
static int decrypt(int argc, char *argv[])
GC_SETIV(c, d.buf);
}
h = GM_INIT(m);
GC_SETIV(c, d.buf);
}
h = GM_INIT(m);
- STORE32(d.buf, seq);
- GH_HASH(h, d.buf, 4);
+ GH_HASHU32(h, seq);
seq++;
chunk_read(e, &d, &b);
if ((tag = buf_get(&b, GM_CLASS(m)->hashsz)) == 0) {
seq++;
chunk_read(e, &d, &b);
if ((tag = buf_get(&b, GM_CLASS(m)->hashsz)) == 0) {