1 /******************************************************************************* 2 3 D bindings to general libgcrypt functions. 4 5 Requires linking with libgcrypt: 6 7 -L-lgcrypt 8 9 Copyright: 10 Copyright (c) 2009-2016 dunnhumby Germany GmbH. 11 All rights reserved. 12 13 License: 14 Boost Software License Version 1.0. See LICENSE_BOOST.txt for details. 15 Alternatively, this file may be distributed under the terms of the Tango 16 3-Clause BSD License (see LICENSE_BSD.txt for details). 17 18 Bear in mind this module provides bindings to an external library that 19 has its own license, which might be more restrictive. Please check the 20 external library license to see which conditions apply for linking. 21 22 *******************************************************************************/ 23 24 module ocean.util.cipher.gcrypt.c.general; 25 26 public import ocean.util.cipher.gcrypt.c.libversion; 27 28 import ocean.transition; 29 30 extern (C): 31 32 /// See original's library documentation for details. 33 alias uint gcry_error_t; 34 35 /// See original's library documentation for details. 36 enum gcry_ctl_cmds 37 { 38 GCRYCTL_CFB_SYNC = 3, 39 GCRYCTL_RESET = 4, 40 GCRYCTL_FINALIZE = 5, 41 GCRYCTL_GET_KEYLEN = 6, 42 GCRYCTL_GET_BLKLEN = 7, 43 GCRYCTL_TEST_ALGO = 8, 44 GCRYCTL_IS_SECURE = 9, 45 GCRYCTL_GET_ASNOID = 10, 46 GCRYCTL_ENABLE_ALGO = 11, 47 GCRYCTL_DISABLE_ALGO = 12, 48 GCRYCTL_DUMP_RANDOM_STATS = 13, 49 GCRYCTL_DUMP_SECMEM_STATS = 14, 50 GCRYCTL_GET_ALGO_NPKEY = 15, 51 GCRYCTL_GET_ALGO_NSKEY = 16, 52 GCRYCTL_GET_ALGO_NSIGN = 17, 53 GCRYCTL_GET_ALGO_NENCR = 18, 54 GCRYCTL_SET_VERBOSITY = 19, 55 GCRYCTL_SET_DEBUG_FLAGS = 20, 56 GCRYCTL_CLEAR_DEBUG_FLAGS = 21, 57 GCRYCTL_USE_SECURE_RNDPOOL= 22, 58 GCRYCTL_DUMP_MEMORY_STATS = 23, 59 GCRYCTL_INIT_SECMEM = 24, 60 GCRYCTL_TERM_SECMEM = 25, 61 GCRYCTL_DISABLE_SECMEM_WARN = 27, 62 GCRYCTL_SUSPEND_SECMEM_WARN = 28, 63 GCRYCTL_RESUME_SECMEM_WARN = 29, 64 GCRYCTL_DROP_PRIVS = 30, 65 GCRYCTL_ENABLE_M_GUARD = 31, 66 GCRYCTL_START_DUMP = 32, 67 GCRYCTL_STOP_DUMP = 33, 68 GCRYCTL_GET_ALGO_USAGE = 34, 69 GCRYCTL_IS_ALGO_ENABLED = 35, 70 GCRYCTL_DISABLE_INTERNAL_LOCKING = 36, 71 GCRYCTL_DISABLE_SECMEM = 37, 72 GCRYCTL_INITIALIZATION_FINISHED = 38, 73 GCRYCTL_INITIALIZATION_FINISHED_P = 39, 74 GCRYCTL_ANY_INITIALIZATION_P = 40, 75 GCRYCTL_SET_CBC_CTS = 41, 76 GCRYCTL_SET_CBC_MAC = 42, 77 GCRYCTL_ENABLE_QUICK_RANDOM = 44, 78 GCRYCTL_SET_RANDOM_SEED_FILE = 45, 79 GCRYCTL_UPDATE_RANDOM_SEED_FILE = 46, 80 GCRYCTL_SET_THREAD_CBS = 47, 81 GCRYCTL_FAST_POLL = 48, 82 GCRYCTL_SET_RANDOM_DAEMON_SOCKET = 49, 83 GCRYCTL_USE_RANDOM_DAEMON = 50, 84 GCRYCTL_FAKED_RANDOM_P = 51, 85 GCRYCTL_SET_RNDEGD_SOCKET = 52, 86 GCRYCTL_PRINT_CONFIG = 53, 87 GCRYCTL_OPERATIONAL_P = 54, 88 GCRYCTL_FIPS_MODE_P = 55, 89 GCRYCTL_FORCE_FIPS_MODE = 56, 90 GCRYCTL_SELFTEST = 57, 91 GCRYCTL_DISABLE_HWF = 63, 92 GCRYCTL_SET_ENFORCED_FIPS_FLAG = 64, 93 GCRYCTL_SET_PREFERRED_RNG_TYPE = 65, 94 GCRYCTL_GET_CURRENT_RNG_TYPE = 66, 95 GCRYCTL_DISABLE_LOCKED_SECMEM = 67, 96 GCRYCTL_DISABLE_PRIV_DROP = 68, 97 GCRYCTL_SET_CCM_LENGTHS = 69, 98 GCRYCTL_CLOSE_RANDOM_DEVICE = 70, 99 GCRYCTL_INACTIVATE_FIPS_FLAG = 71, 100 GCRYCTL_REACTIVATE_FIPS_FLAG = 72, 101 GCRYCTL_SET_SBOX = 73, 102 GCRYCTL_DRBG_REINIT = 74, 103 GCRYCTL_SET_TAGLEN = 75 104 } 105 106 /// See original's library documentation for details. 107 gcry_error_t gcry_control ( gcry_ctl_cmds CMD, ...); 108 109 // The function gcry_strerror returns a pointer to a statically allocated string 110 // containing a description of the error code contained in the error value err. 111 // This string can be used to output a diagnostic message to the user. 112 Const!(char)* gcry_strerror (gcry_error_t err); 113 114 // The function gcry_strsource returns a pointer to a statically allocated 115 // string containing a description of the error source contained in the error 116 // value err. This string can be used to output a diagnostic message to the user. 117 Const!(char)* gcry_strsource (gcry_error_t err);