"Fossies" - the Fresh Open Source Software Archive

Member "cryptsetup-2.4.3/lib/utils_crypt.h" (13 Jan 2022, 1591 Bytes) of package /linux/misc/cryptsetup-2.4.3.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "utils_crypt.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 2.3.6_vs_2.4.0.

    1 /*
    2  * utils_crypt - cipher utilities for cryptsetup
    3  *
    4  * Copyright (C) 2004-2007 Clemens Fruhwirth <clemens@endorphin.org>
    5  * Copyright (C) 2009-2021 Red Hat, Inc. All rights reserved.
    6  * Copyright (C) 2009-2021 Milan Broz
    7  *
    8  * This program is free software; you can redistribute it and/or
    9  * modify it under the terms of the GNU General Public License
   10  * as published by the Free Software Foundation; either version 2
   11  * of the License, or (at your option) any later version.
   12  *
   13  * This program is distributed in the hope that it will be useful,
   14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   16  * GNU General Public License for more details.
   17  *
   18  * You should have received a copy of the GNU General Public License
   19  * along with this program; if not, write to the Free Software
   20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
   21  */
   22 
   23 #ifndef _UTILS_CRYPT_H
   24 #define _UTILS_CRYPT_H
   25 
   26 #include <stdbool.h>
   27 
   28 #define MAX_CIPHER_LEN      32
   29 #define MAX_CIPHER_LEN_STR  "31"
   30 #define MAX_KEYFILES        32
   31 
   32 int crypt_parse_name_and_mode(const char *s, char *cipher,
   33                   int *key_nums, char *cipher_mode);
   34 int crypt_parse_hash_integrity_mode(const char *s, char *integrity);
   35 int crypt_parse_integrity_mode(const char *s, char *integrity,
   36                    int *integrity_key_size);
   37 int crypt_parse_pbkdf(const char *s, const char **pbkdf);
   38 
   39 ssize_t crypt_hex_to_bytes(const char *hex, char **result, int safe_alloc);
   40 
   41 bool crypt_is_cipher_null(const char *cipher_spec);
   42 
   43 #endif /* _UTILS_CRYPT_H */