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 extern (C):
29 
30 /// See original's library documentation for details.
31 alias uint gcry_error_t;
32 
33 /// See original's library documentation for details.
34 enum gcry_ctl_cmds
35 {
36     GCRYCTL_CFB_SYNC = 3,
37     GCRYCTL_RESET    = 4,
38     GCRYCTL_FINALIZE = 5,
39     GCRYCTL_GET_KEYLEN = 6,
40     GCRYCTL_GET_BLKLEN = 7,
41     GCRYCTL_TEST_ALGO = 8,
42     GCRYCTL_IS_SECURE = 9,
43     GCRYCTL_GET_ASNOID = 10,
44     GCRYCTL_ENABLE_ALGO = 11,
45     GCRYCTL_DISABLE_ALGO = 12,
46     GCRYCTL_DUMP_RANDOM_STATS = 13,
47     GCRYCTL_DUMP_SECMEM_STATS = 14,
48     GCRYCTL_GET_ALGO_NPKEY    = 15,
49     GCRYCTL_GET_ALGO_NSKEY    = 16,
50     GCRYCTL_GET_ALGO_NSIGN    = 17,
51     GCRYCTL_GET_ALGO_NENCR    = 18,
52     GCRYCTL_SET_VERBOSITY     = 19,
53     GCRYCTL_SET_DEBUG_FLAGS   = 20,
54     GCRYCTL_CLEAR_DEBUG_FLAGS = 21,
55     GCRYCTL_USE_SECURE_RNDPOOL= 22,
56     GCRYCTL_DUMP_MEMORY_STATS = 23,
57     GCRYCTL_INIT_SECMEM       = 24,
58     GCRYCTL_TERM_SECMEM       = 25,
59     GCRYCTL_DISABLE_SECMEM_WARN = 27,
60     GCRYCTL_SUSPEND_SECMEM_WARN = 28,
61     GCRYCTL_RESUME_SECMEM_WARN  = 29,
62     GCRYCTL_DROP_PRIVS          = 30,
63     GCRYCTL_ENABLE_M_GUARD      = 31,
64     GCRYCTL_START_DUMP          = 32,
65     GCRYCTL_STOP_DUMP           = 33,
66     GCRYCTL_GET_ALGO_USAGE      = 34,
67     GCRYCTL_IS_ALGO_ENABLED     = 35,
68     GCRYCTL_DISABLE_INTERNAL_LOCKING = 36,
69     GCRYCTL_DISABLE_SECMEM      = 37,
70     GCRYCTL_INITIALIZATION_FINISHED = 38,
71     GCRYCTL_INITIALIZATION_FINISHED_P = 39,
72     GCRYCTL_ANY_INITIALIZATION_P = 40,
73     GCRYCTL_SET_CBC_CTS = 41,
74     GCRYCTL_SET_CBC_MAC = 42,
75     GCRYCTL_ENABLE_QUICK_RANDOM = 44,
76     GCRYCTL_SET_RANDOM_SEED_FILE = 45,
77     GCRYCTL_UPDATE_RANDOM_SEED_FILE = 46,
78     GCRYCTL_SET_THREAD_CBS = 47,
79     GCRYCTL_FAST_POLL = 48,
80     GCRYCTL_SET_RANDOM_DAEMON_SOCKET = 49,
81     GCRYCTL_USE_RANDOM_DAEMON = 50,
82     GCRYCTL_FAKED_RANDOM_P = 51,
83     GCRYCTL_SET_RNDEGD_SOCKET = 52,
84     GCRYCTL_PRINT_CONFIG = 53,
85     GCRYCTL_OPERATIONAL_P = 54,
86     GCRYCTL_FIPS_MODE_P = 55,
87     GCRYCTL_FORCE_FIPS_MODE = 56,
88     GCRYCTL_SELFTEST = 57,
89     GCRYCTL_DISABLE_HWF = 63,
90     GCRYCTL_SET_ENFORCED_FIPS_FLAG = 64,
91     GCRYCTL_SET_PREFERRED_RNG_TYPE = 65,
92     GCRYCTL_GET_CURRENT_RNG_TYPE = 66,
93     GCRYCTL_DISABLE_LOCKED_SECMEM = 67,
94     GCRYCTL_DISABLE_PRIV_DROP = 68,
95     GCRYCTL_SET_CCM_LENGTHS = 69,
96     GCRYCTL_CLOSE_RANDOM_DEVICE = 70,
97     GCRYCTL_INACTIVATE_FIPS_FLAG = 71,
98     GCRYCTL_REACTIVATE_FIPS_FLAG = 72,
99     GCRYCTL_SET_SBOX = 73,
100     GCRYCTL_DRBG_REINIT = 74,
101     GCRYCTL_SET_TAGLEN = 75
102 }
103 
104 /// See original's library documentation for details.
105 gcry_error_t gcry_control (gcry_ctl_cmds CMD, ...);
106 
107 // The function gcry_strerror returns a pointer to a statically allocated string
108 // containing a description of the error code contained in the error value err.
109 // This string can be used to output a diagnostic message to the user.
110 const(char)* gcry_strerror (gcry_error_t err);
111 
112 // The function gcry_strsource returns a pointer to a statically allocated
113 // string containing a description of the error source contained in the error
114 // value err. This string can be used to output a diagnostic message to the user.
115 const(char)* gcry_strsource (gcry_error_t err);