"Fossies" - the Fresh Open Source Software Archive

Member "src/Common/Pkcs5.h" (10 Oct 2018, 2474 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


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 "Pkcs5.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  Legal Notice: Some portions of the source code contained in this file were
    3  derived from the source code of TrueCrypt 7.1a, which is
    4  Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
    5  governed by the TrueCrypt License 3.0, also from the source code of
    6  Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
    7  and which is governed by the 'License Agreement for Encryption for the Masses'
    8  Modifications and additions to the original source code (contained in this file)
    9  and all other portions of this file are Copyright (c) 2013-2017 IDRIX
   10  and are governed by the Apache License 2.0 the full text of which is
   11  contained in the file License.txt included in VeraCrypt binary and source
   12  code distribution packages. */
   13 
   14 #ifndef TC_HEADER_PKCS5
   15 #define TC_HEADER_PKCS5
   16 
   17 #include "Tcdefs.h"
   18 
   19 #if defined(__cplusplus)
   20 extern "C"
   21 {
   22 #endif
   23 /* output written to input_digest which must be at lease 20 bytes long */
   24 void hmac_ripemd160 (char *key, int keylen, char *input_digest, int len);
   25 void derive_key_ripemd160 (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen);
   26 
   27 /* output written to d which must be at lease 32 bytes long */
   28 void hmac_sha256 (char *k, int lk, char *d, int ld);
   29 void derive_key_sha256 (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen);
   30 
   31 #ifndef TC_WINDOWS_BOOT
   32 /* output written to d which must be at lease 64 bytes long */
   33 void hmac_sha512 (char *k, int lk, char *d, int ld);
   34 void derive_key_sha512 (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen);
   35 
   36 /* output written to d which must be at lease 64 bytes long */
   37 void hmac_whirlpool (char *k, int lk, char *d, int ld);
   38 void derive_key_whirlpool (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen);
   39 
   40 void hmac_streebog (char *k, int32 lk, char *d, int32 ld);
   41 void derive_key_streebog (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen);
   42 
   43 int get_pkcs5_iteration_count (int pkcs5_prf_id, int pim, BOOL truecryptMode, BOOL bBoot);
   44 wchar_t *get_pkcs5_prf_name (int pkcs5_prf_id);
   45 
   46 /* check if given PRF supported.*/
   47 typedef enum
   48 {
   49    PRF_BOOT_NO = 0,
   50    PRF_BOOT_MBR,
   51    PRF_BOOT_GPT
   52 } PRF_BOOT_TYPE;
   53 
   54 int is_pkcs5_prf_supported (int pkcs5_prf_id, BOOL truecryptMode, PRF_BOOT_TYPE bootType);
   55 #endif
   56 
   57 #if defined(__cplusplus)
   58 }
   59 #endif
   60 
   61 #endif // TC_HEADER_PKCS5