static int hash_accept(struct socket *sock, struct socket *newsock, int flags,
#include <crypto/if_alg.h>
#include <linux/kernel.h>
#include <linux/module.h>
struct ahash_request req;
static int hash_alloc_result(struct sock *sk, struct hash_ctx *ctx)
ds = crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req));
ctx->result = sock_kmalloc(sk, ds, GFP_KERNEL);
memset(ctx->result, 0, ds);
static void hash_free_result(struct sock *sk, struct hash_ctx *ctx)
ds = crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req));
sock_kzfree_s(sk, ctx->result, ds);
static int hash_sendmsg(struct socket *sock, struct msghdr *msg,