89c0af836a08b625a21e3013cf691e2369be41e0
[platform/upstream/cryptsetup.git] / lib / luks1 / af.h
1 /*
2  * AFsplitter - Anti forensic information splitter
3  *
4  * Copyright (C) 2004, Clemens Fruhwirth <clemens@endorphin.org>
5  * Copyright (C) 2009-2012, Red Hat, Inc. All rights reserved.
6  *
7  * AFsplitter diffuses information over a large stripe of data,
8  * therefor supporting secure data destruction.
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * version 2 as published by the Free Software Foundation.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 #ifndef INCLUDED_CRYPTSETUP_LUKS_AF_H
24 #define INCLUDED_CRYPTSETUP_LUKS_AF_H
25
26 /*
27  * AF_split operates on src and produces information split data in
28  * dst. src is assumed to be of the length blocksize. The data stripe
29  * dst points to must be capable of storing blocksize*blocknumbers.
30  * blocknumbers is the data multiplication factor.
31  *
32  * AF_merge does just the opposite: reproduces the information stored in
33  * src of the length blocksize*blocknumbers into dst of the length
34  * blocksize.
35  *
36  * On error, both functions return -1, 0 otherwise.
37  */
38
39 int AF_split(char *src, char *dst, size_t blocksize, unsigned int blocknumbers, const char *hash);
40 int AF_merge(char *src, char *dst, size_t blocksize, unsigned int blocknumbers, const char *hash);
41 size_t AF_split_sectors(size_t blocksize, unsigned int blocknumbers);
42
43 #endif