-static const ghash_ops gops = { &pre, ghhash, ghdone, ghdestroy }; \
-const gchash pre = { #pre, PRE##_HASHSZ, ghinit };
+static ghash *ghcopy(ghash *h) \
+{ \
+ gctx *g = (gctx *)h; \
+ gctx *gg = S_CREATE(gctx); \
+ memcpy(gg, g, sizeof(gctx)); \
+ return (&gg->h); \
+} \
+ \
+static const ghash_ops gops = \
+ { &pre, ghhash, ghdone, ghdestroy, ghcopy }; \
+const gchash pre = { #pre, PRE##_HASHSZ, ghinit, PRE##_BUFSZ };