~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
progs/cc-kem.c: Add `naclbox' crypto transform.
[catacomb]
/
symm
/
counter-def.h
diff --git
a/symm/counter-def.h
b/symm/counter-def.h
index
2f35323
..
4553679
100644
(file)
--- a/
symm/counter-def.h
+++ b/
symm/counter-def.h
@@
-398,7
+398,7
@@
static const grand_ops grops = { \
#pre "-counter", \
GRAND_CRYPTO, 0, \
grmisc, grdestroy, \
#pre "-counter", \
GRAND_CRYPTO, 0, \
grmisc, grdestroy, \
- grword, grbyte, grword, grand_
range, grfill
\
+ grword, grbyte, grword, grand_
defaultrange, grfill
\
}; \
\
/* --- @pre_counterrand@ --- * \
}; \
\
/* --- @pre_counterrand@ --- * \
@@
-453,12
+453,12
@@
static const octet iv[] = IV; \
static octet ct[sizeof(text)]; \
static octet pt[sizeof(text)]; \
\
static octet ct[sizeof(text)]; \
static octet pt[sizeof(text)]; \
\
-static void hexdump(const octet *p, size_t sz
)
\
+static void hexdump(const octet *p, size_t sz
, size_t off)
\
{ \
const octet *q = p + sz; \
for (sz = 0; p < q; p++, sz++) { \
printf("%02x", *p); \
{ \
const octet *q = p + sz; \
for (sz = 0; p < q; p++, sz++) { \
printf("%02x", *p); \
- if ((
sz + 1) % PRE##_BLKSZ == 0)
\
+ if ((
off + sz + 1) % PRE##_BLKSZ == 0)
\
putchar(':'); \
} \
} \
putchar(':'); \
} \
} \
@@
-499,14
+499,14
@@
int main(void) \
} else { \
printf("\nError (sz = %lu)\n", (unsigned long)sz); \
status = 1; \
} else { \
printf("\nError (sz = %lu)\n", (unsigned long)sz); \
status = 1; \
- printf("\tplaintext = "); hexdump(text, sz
);
\
- printf(", "); hexdump(text + sz, rest
);
\
+ printf("\tplaintext = "); hexdump(text, sz
, 0);
\
+ printf(", "); hexdump(text + sz, rest
, sz);
\
fputc('\n', stdout); \
fputc('\n', stdout); \
- printf("\tciphertext = "); hexdump(ct, sz
);
\
- printf(", "); hexdump(ct + sz, rest
);
\
+ printf("\tciphertext = "); hexdump(ct, sz
, 0);
\
+ printf(", "); hexdump(ct + sz, rest
, sz);
\
fputc('\n', stdout); \
fputc('\n', stdout); \
- printf("\trecovered text = "); hexdump(pt, sz
);
\
- printf(", "); hexdump(pt + sz, rest
);
\
+ printf("\trecovered text = "); hexdump(pt, sz
, 0);
\
+ printf(", "); hexdump(pt + sz, rest
, sz);
\
fputc('\n', stdout); \
fputc('\n', stdout); \
} \
fputc('\n', stdout); \
fputc('\n', stdout); \
} \