]> git.sesse.net Git - bcachefs-tools-debian/blob - include/crypto/algapi.h
New on disk format - encryption
[bcachefs-tools-debian] / include / crypto / algapi.h
1 /*
2  * Cryptographic API for algorithms (i.e., low-level API).
3  *
4  * Copyright (c) 2006 Herbert Xu <herbert@gondor.apana.org.au>
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the Free
8  * Software Foundation; either version 2 of the License, or (at your option) 
9  * any later version.
10  *
11  */
12 #ifndef _CRYPTO_ALGAPI_H
13 #define _CRYPTO_ALGAPI_H
14
15 #include <linux/crypto.h>
16
17 struct crypto_type {
18         unsigned int (*ctxsize)(struct crypto_alg *alg, u32 type, u32 mask);
19         unsigned int (*extsize)(struct crypto_alg *alg);
20         int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask);
21         int (*init_tfm)(struct crypto_tfm *tfm);
22
23         unsigned        type;
24         unsigned        maskclear;
25         unsigned        maskset;
26         unsigned        tfmsize;
27 };
28
29 extern const struct crypto_type crypto_blkcipher_type;
30
31 static inline void *crypto_blkcipher_ctx(struct crypto_blkcipher *tfm)
32 {
33         return crypto_tfm_ctx(&tfm->base);
34 }
35
36 #endif  /* _CRYPTO_ALGAPI_H */