revert-mm-fix-blkdev-size-calculation-in-generic_write_checks
[linux-2.6/linux-trees-mm.git] / fs / reiser4 / plugin / crypto / digest.c
blob7508917d44073b1a7559abe08178f6082d6234f2
1 /* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */
3 /* reiser4 digest transform plugin (is used by cryptcompress object plugin) */
4 /* EDWARD-FIXME-HANS: and it does what? a digest is a what? */
5 #include "../../debug.h"
6 #include "../plugin_header.h"
7 #include "../plugin.h"
8 #include "../file/cryptcompress.h"
10 #include <linux/types.h>
12 extern digest_plugin digest_plugins[LAST_DIGEST_ID];
14 static struct crypto_hash * alloc_sha256 (void)
16 #if REISER4_SHA256
17 return crypto_alloc_hash ("sha256", 0, CRYPTO_ALG_ASYNC);
18 #else
19 warning("edward-1418", "sha256 unsupported");
20 return ERR_PTR(-EINVAL);
21 #endif
24 static void free_sha256 (struct crypto_hash * tfm)
26 #if REISER4_SHA256
27 crypto_free_hash(tfm);
28 #endif
29 return;
32 /* digest plugins */
33 digest_plugin digest_plugins[LAST_DIGEST_ID] = {
34 [SHA256_32_DIGEST_ID] = {
35 .h = {
36 .type_id = REISER4_DIGEST_PLUGIN_TYPE,
37 .id = SHA256_32_DIGEST_ID,
38 .pops = NULL,
39 .label = "sha256_32",
40 .desc = "sha256_32 digest transform",
41 .linkage = {NULL, NULL}
43 .fipsize = sizeof(__u32),
44 .alloc = alloc_sha256,
45 .free = free_sha256
50 Local variables:
51 c-indentation-style: "K&R"
52 mode-name: "LC"
53 c-basic-offset: 8
54 tab-width: 8
55 fill-column: 120
56 scroll-step: 1
57 End: