/src/dropbear/libtomcrypt/src/headers/tomcrypt_macros.h
Line | Count | Source |
1 | | /* LibTomCrypt, modular cryptographic library -- Tom St Denis |
2 | | * |
3 | | * LibTomCrypt is a library that provides various cryptographic |
4 | | * algorithms in a highly modular and flexible manner. |
5 | | * |
6 | | * The library is free for all purposes without any express |
7 | | * guarantee it works. |
8 | | */ |
9 | | |
10 | | /* ---- HELPER MACROS ---- */ |
11 | | #ifdef ENDIAN_NEUTRAL |
12 | | |
13 | | #define STORE32L(x, y) \ |
14 | | do { (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ |
15 | | (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } while(0) |
16 | | |
17 | | #define LOAD32L(x, y) \ |
18 | | do { x = ((ulong32)((y)[3] & 255)<<24) | \ |
19 | | ((ulong32)((y)[2] & 255)<<16) | \ |
20 | | ((ulong32)((y)[1] & 255)<<8) | \ |
21 | | ((ulong32)((y)[0] & 255)); } while(0) |
22 | | |
23 | | #define STORE64L(x, y) \ |
24 | | do { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ |
25 | | (y)[5] = (unsigned char)(((x)>>40)&255); (y)[4] = (unsigned char)(((x)>>32)&255); \ |
26 | | (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ |
27 | | (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } while(0) |
28 | | |
29 | | #define LOAD64L(x, y) \ |
30 | | do { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48)| \ |
31 | | (((ulong64)((y)[5] & 255))<<40)|(((ulong64)((y)[4] & 255))<<32)| \ |
32 | | (((ulong64)((y)[3] & 255))<<24)|(((ulong64)((y)[2] & 255))<<16)| \ |
33 | | (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); } while(0) |
34 | | |
35 | | #define STORE32H(x, y) \ |
36 | | do { (y)[0] = (unsigned char)(((x)>>24)&255); (y)[1] = (unsigned char)(((x)>>16)&255); \ |
37 | | (y)[2] = (unsigned char)(((x)>>8)&255); (y)[3] = (unsigned char)((x)&255); } while(0) |
38 | | |
39 | | #define LOAD32H(x, y) \ |
40 | | do { x = ((ulong32)((y)[0] & 255)<<24) | \ |
41 | | ((ulong32)((y)[1] & 255)<<16) | \ |
42 | | ((ulong32)((y)[2] & 255)<<8) | \ |
43 | | ((ulong32)((y)[3] & 255)); } while(0) |
44 | | |
45 | | #define STORE64H(x, y) \ |
46 | | do { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ |
47 | | (y)[2] = (unsigned char)(((x)>>40)&255); (y)[3] = (unsigned char)(((x)>>32)&255); \ |
48 | | (y)[4] = (unsigned char)(((x)>>24)&255); (y)[5] = (unsigned char)(((x)>>16)&255); \ |
49 | | (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); } while(0) |
50 | | |
51 | | #define LOAD64H(x, y) \ |
52 | | do { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48) | \ |
53 | | (((ulong64)((y)[2] & 255))<<40)|(((ulong64)((y)[3] & 255))<<32) | \ |
54 | | (((ulong64)((y)[4] & 255))<<24)|(((ulong64)((y)[5] & 255))<<16) | \ |
55 | | (((ulong64)((y)[6] & 255))<<8)|(((ulong64)((y)[7] & 255))); } while(0) |
56 | | |
57 | | |
58 | | #elif defined(ENDIAN_LITTLE) |
59 | | |
60 | | #ifdef LTC_HAVE_BSWAP_BUILTIN |
61 | | |
62 | 7.48k | #define STORE32H(x, y) \ |
63 | 7.48k | do { ulong32 __t = __builtin_bswap32 ((x)); \ |
64 | 7.48k | XMEMCPY ((y), &__t, 4); } while(0) |
65 | | |
66 | 15.3k | #define LOAD32H(x, y) \ |
67 | 15.3k | do { XMEMCPY (&(x), (y), 4); \ |
68 | 15.3k | (x) = __builtin_bswap32 ((x)); } while(0) |
69 | | |
70 | | #elif !defined(LTC_NO_BSWAP) && (defined(INTEL_CC) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__) || defined(__x86_64__)))) |
71 | | |
72 | | #define STORE32H(x, y) \ |
73 | | asm __volatile__ ( \ |
74 | | "bswapl %0 \n\t" \ |
75 | | "movl %0,(%1)\n\t" \ |
76 | | "bswapl %0 \n\t" \ |
77 | | ::"r"(x), "r"(y)); |
78 | | |
79 | | #define LOAD32H(x, y) \ |
80 | | asm __volatile__ ( \ |
81 | | "movl (%1),%0\n\t" \ |
82 | | "bswapl %0\n\t" \ |
83 | | :"=r"(x): "r"(y)); |
84 | | |
85 | | #else |
86 | | |
87 | | #define STORE32H(x, y) \ |
88 | | do { (y)[0] = (unsigned char)(((x)>>24)&255); (y)[1] = (unsigned char)(((x)>>16)&255); \ |
89 | | (y)[2] = (unsigned char)(((x)>>8)&255); (y)[3] = (unsigned char)((x)&255); } while(0) |
90 | | |
91 | | #define LOAD32H(x, y) \ |
92 | | do { x = ((ulong32)((y)[0] & 255)<<24) | \ |
93 | | ((ulong32)((y)[1] & 255)<<16) | \ |
94 | | ((ulong32)((y)[2] & 255)<<8) | \ |
95 | | ((ulong32)((y)[3] & 255)); } while(0) |
96 | | |
97 | | #endif |
98 | | |
99 | | #ifdef LTC_HAVE_BSWAP_BUILTIN |
100 | | |
101 | 935 | #define STORE64H(x, y) \ |
102 | 935 | do { ulong64 __t = __builtin_bswap64 ((x)); \ |
103 | 935 | XMEMCPY ((y), &__t, 8); } while(0) |
104 | | |
105 | 0 | #define LOAD64H(x, y) \ |
106 | 0 | do { XMEMCPY (&(x), (y), 8); \ |
107 | 0 | (x) = __builtin_bswap64 ((x)); } while(0) |
108 | | |
109 | | /* x86_64 processor */ |
110 | | #elif !defined(LTC_NO_BSWAP) && (defined(__GNUC__) && defined(__x86_64__)) |
111 | | |
112 | | #define STORE64H(x, y) \ |
113 | | asm __volatile__ ( \ |
114 | | "bswapq %0 \n\t" \ |
115 | | "movq %0,(%1)\n\t" \ |
116 | | "bswapq %0 \n\t" \ |
117 | | ::"r"(x), "r"(y): "memory"); |
118 | | |
119 | | #define LOAD64H(x, y) \ |
120 | | asm __volatile__ ( \ |
121 | | "movq (%1),%0\n\t" \ |
122 | | "bswapq %0\n\t" \ |
123 | | :"=r"(x): "r"(y): "memory"); |
124 | | |
125 | | #else |
126 | | |
127 | | #define STORE64H(x, y) \ |
128 | | do { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ |
129 | | (y)[2] = (unsigned char)(((x)>>40)&255); (y)[3] = (unsigned char)(((x)>>32)&255); \ |
130 | | (y)[4] = (unsigned char)(((x)>>24)&255); (y)[5] = (unsigned char)(((x)>>16)&255); \ |
131 | | (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); } while(0) |
132 | | |
133 | | #define LOAD64H(x, y) \ |
134 | | do { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48) | \ |
135 | | (((ulong64)((y)[2] & 255))<<40)|(((ulong64)((y)[3] & 255))<<32) | \ |
136 | | (((ulong64)((y)[4] & 255))<<24)|(((ulong64)((y)[5] & 255))<<16) | \ |
137 | | (((ulong64)((y)[6] & 255))<<8)|(((ulong64)((y)[7] & 255))); } while(0) |
138 | | |
139 | | #endif |
140 | | |
141 | | #ifdef ENDIAN_32BITWORD |
142 | | |
143 | | #define STORE32L(x, y) \ |
144 | | do { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } while(0) |
145 | | |
146 | | #define LOAD32L(x, y) \ |
147 | | do { XMEMCPY(&(x), y, 4); } while(0) |
148 | | |
149 | | #define STORE64L(x, y) \ |
150 | | do { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ |
151 | | (y)[5] = (unsigned char)(((x)>>40)&255); (y)[4] = (unsigned char)(((x)>>32)&255); \ |
152 | | (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ |
153 | | (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } while(0) |
154 | | |
155 | | #define LOAD64L(x, y) \ |
156 | | do { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48)| \ |
157 | | (((ulong64)((y)[5] & 255))<<40)|(((ulong64)((y)[4] & 255))<<32)| \ |
158 | | (((ulong64)((y)[3] & 255))<<24)|(((ulong64)((y)[2] & 255))<<16)| \ |
159 | | (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); } while(0) |
160 | | |
161 | | #else /* 64-bit words then */ |
162 | | |
163 | | #define STORE32L(x, y) \ |
164 | 0 | do { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } while(0) |
165 | | |
166 | | #define LOAD32L(x, y) \ |
167 | 0 | do { XMEMCPY(&(x), y, 4); x &= 0xFFFFFFFF; } while(0) |
168 | | |
169 | | #define STORE64L(x, y) \ |
170 | | do { ulong64 __t = (x); XMEMCPY(y, &__t, 8); } while(0) |
171 | | |
172 | | #define LOAD64L(x, y) \ |
173 | | do { XMEMCPY(&(x), y, 8); } while(0) |
174 | | |
175 | | #endif /* ENDIAN_64BITWORD */ |
176 | | |
177 | | #elif defined(ENDIAN_BIG) |
178 | | |
179 | | #define STORE32L(x, y) \ |
180 | | do { (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ |
181 | | (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } while(0) |
182 | | |
183 | | #define LOAD32L(x, y) \ |
184 | | do { x = ((ulong32)((y)[3] & 255)<<24) | \ |
185 | | ((ulong32)((y)[2] & 255)<<16) | \ |
186 | | ((ulong32)((y)[1] & 255)<<8) | \ |
187 | | ((ulong32)((y)[0] & 255)); } while(0) |
188 | | |
189 | | #define STORE64L(x, y) \ |
190 | | do { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ |
191 | | (y)[5] = (unsigned char)(((x)>>40)&255); (y)[4] = (unsigned char)(((x)>>32)&255); \ |
192 | | (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ |
193 | | (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } while(0) |
194 | | |
195 | | #define LOAD64L(x, y) \ |
196 | | do { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48) | \ |
197 | | (((ulong64)((y)[5] & 255))<<40)|(((ulong64)((y)[4] & 255))<<32) | \ |
198 | | (((ulong64)((y)[3] & 255))<<24)|(((ulong64)((y)[2] & 255))<<16) | \ |
199 | | (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); } while(0) |
200 | | |
201 | | #ifdef ENDIAN_32BITWORD |
202 | | |
203 | | #define STORE32H(x, y) \ |
204 | | do { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } while(0) |
205 | | |
206 | | #define LOAD32H(x, y) \ |
207 | | do { XMEMCPY(&(x), y, 4); } while(0) |
208 | | |
209 | | #define STORE64H(x, y) \ |
210 | | do { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ |
211 | | (y)[2] = (unsigned char)(((x)>>40)&255); (y)[3] = (unsigned char)(((x)>>32)&255); \ |
212 | | (y)[4] = (unsigned char)(((x)>>24)&255); (y)[5] = (unsigned char)(((x)>>16)&255); \ |
213 | | (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); } while(0) |
214 | | |
215 | | #define LOAD64H(x, y) \ |
216 | | do { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48)| \ |
217 | | (((ulong64)((y)[2] & 255))<<40)|(((ulong64)((y)[3] & 255))<<32)| \ |
218 | | (((ulong64)((y)[4] & 255))<<24)|(((ulong64)((y)[5] & 255))<<16)| \ |
219 | | (((ulong64)((y)[6] & 255))<<8)| (((ulong64)((y)[7] & 255))); } while(0) |
220 | | |
221 | | #else /* 64-bit words then */ |
222 | | |
223 | | #define STORE32H(x, y) \ |
224 | | do { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } while(0) |
225 | | |
226 | | #define LOAD32H(x, y) \ |
227 | | do { XMEMCPY(&(x), y, 4); x &= 0xFFFFFFFF; } while(0) |
228 | | |
229 | | #define STORE64H(x, y) \ |
230 | | do { ulong64 __t = (x); XMEMCPY(y, &__t, 8); } while(0) |
231 | | |
232 | | #define LOAD64H(x, y) \ |
233 | | do { XMEMCPY(&(x), y, 8); } while(0) |
234 | | |
235 | | #endif /* ENDIAN_64BITWORD */ |
236 | | #endif /* ENDIAN_BIG */ |
237 | | |
238 | | #define BSWAP(x) ( ((x>>24)&0x000000FFUL) | ((x<<24)&0xFF000000UL) | \ |
239 | | ((x>>8)&0x0000FF00UL) | ((x<<8)&0x00FF0000UL) ) |
240 | | |
241 | | |
242 | | /* 32-bit Rotates */ |
243 | | #if defined(_MSC_VER) |
244 | | #define LTC_ROx_ASM |
245 | | |
246 | | /* instrinsic rotate */ |
247 | | #include <stdlib.h> |
248 | | #pragma intrinsic(_lrotr,_lrotl) |
249 | | #define ROR(x,n) _lrotr(x,n) |
250 | | #define ROL(x,n) _lrotl(x,n) |
251 | | #define RORc(x,n) _lrotr(x,n) |
252 | | #define ROLc(x,n) _lrotl(x,n) |
253 | | |
254 | | #elif !defined(__STRICT_ANSI__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(INTEL_CC) && !defined(LTC_NO_ASM) |
255 | | #define LTC_ROx_ASM |
256 | | |
257 | | static inline ulong32 ROL(ulong32 word, int i) |
258 | 0 | { |
259 | 0 | asm ("roll %%cl,%0" |
260 | 0 | :"=r" (word) |
261 | 0 | :"0" (word),"c" (i)); |
262 | 0 | return word; |
263 | 0 | } Unexecuted instantiation: fuzzer-kexmlkem-cli.c:ROL Unexecuted instantiation: dbutil.c:ROL Unexecuted instantiation: buffer.c:ROL Unexecuted instantiation: dbhelpers.c:ROL Unexecuted instantiation: dss.c:ROL Unexecuted instantiation: bignum.c:ROL Unexecuted instantiation: signkey.c:ROL Unexecuted instantiation: rsa.c:ROL Unexecuted instantiation: dbrandom.c:ROL Unexecuted instantiation: queue.c:ROL Unexecuted instantiation: atomicio.c:ROL Unexecuted instantiation: compat.c:ROL Unexecuted instantiation: fake-rfc2553.c:ROL Unexecuted instantiation: ltc_prng.c:ROL Unexecuted instantiation: ecc.c:ROL Unexecuted instantiation: ecdsa.c:ROL Unexecuted instantiation: sk-ecdsa.c:ROL Unexecuted instantiation: crypto_desc.c:ROL Unexecuted instantiation: curve25519.c:ROL Unexecuted instantiation: ed25519.c:ROL Unexecuted instantiation: sk-ed25519.c:ROL Unexecuted instantiation: dbmalloc.c:ROL Unexecuted instantiation: gensignkey.c:ROL Unexecuted instantiation: gendss.c:ROL Unexecuted instantiation: genrsa.c:ROL Unexecuted instantiation: gened25519.c:ROL Unexecuted instantiation: fuzz-common.c:ROL Unexecuted instantiation: fuzz-wrapfd.c:ROL Unexecuted instantiation: common-session.c:ROL Unexecuted instantiation: packet.c:ROL Unexecuted instantiation: common-algo.c:ROL Unexecuted instantiation: common-kex.c:ROL Unexecuted instantiation: common-channel.c:ROL Unexecuted instantiation: common-chansession.c:ROL Unexecuted instantiation: termcodes.c:ROL Unexecuted instantiation: loginrec.c:ROL Unexecuted instantiation: tcp-accept.c:ROL Unexecuted instantiation: listener.c:ROL Unexecuted instantiation: process-packet.c:ROL Unexecuted instantiation: common-runopts.c:ROL Unexecuted instantiation: circbuffer.c:ROL Unexecuted instantiation: list.c:ROL Unexecuted instantiation: netio.c:ROL Unexecuted instantiation: chachapoly.c:ROL Unexecuted instantiation: gcm.c:ROL Unexecuted instantiation: kex-x25519.c:ROL Unexecuted instantiation: kex-dh.c:ROL Unexecuted instantiation: kex-ecdh.c:ROL Unexecuted instantiation: kex-pqhybrid.c:ROL Unexecuted instantiation: sntrup761.c:ROL Unexecuted instantiation: mlkem768.c:ROL Unexecuted instantiation: cli-auth.c:ROL Unexecuted instantiation: cli-authpasswd.c:ROL Unexecuted instantiation: cli-kex.c:ROL Unexecuted instantiation: cli-session.c:ROL Unexecuted instantiation: cli-runopts.c:ROL Unexecuted instantiation: cli-chansession.c:ROL Unexecuted instantiation: cli-authpubkey.c:ROL Unexecuted instantiation: cli-tcpfwd.c:ROL Unexecuted instantiation: cli-channel.c:ROL Unexecuted instantiation: cli-authinteract.c:ROL Unexecuted instantiation: cli-agentfwd.c:ROL Unexecuted instantiation: cli-readconf.c:ROL Unexecuted instantiation: svr-kex.c:ROL Unexecuted instantiation: svr-auth.c:ROL Unexecuted instantiation: sshpty.c:ROL Unexecuted instantiation: svr-authpasswd.c:ROL Unexecuted instantiation: svr-authpubkey.c:ROL Unexecuted instantiation: svr-authpubkeyoptions.c:ROL Unexecuted instantiation: svr-session.c:ROL Unexecuted instantiation: svr-service.c:ROL Unexecuted instantiation: svr-chansession.c:ROL Unexecuted instantiation: svr-runopts.c:ROL Unexecuted instantiation: svr-agentfwd.c:ROL Unexecuted instantiation: svr-x11fwd.c:ROL Unexecuted instantiation: svr-tcpfwd.c:ROL Unexecuted instantiation: svr-authpam.c:ROL Unexecuted instantiation: aes.c:ROL Unexecuted instantiation: sha1.c:ROL Unexecuted instantiation: sha256.c:ROL Unexecuted instantiation: sha384.c:ROL Unexecuted instantiation: sha512.c:ROL Unexecuted instantiation: hmac_done.c:ROL Unexecuted instantiation: hmac_init.c:ROL Unexecuted instantiation: hmac_process.c:ROL Unexecuted instantiation: poly1305.c:ROL Unexecuted instantiation: ltm_desc.c:ROL Unexecuted instantiation: multi.c:ROL Unexecuted instantiation: base64_decode.c:ROL Unexecuted instantiation: base64_encode.c:ROL Unexecuted instantiation: crypt_argchk.c:ROL Unexecuted instantiation: crypt_find_cipher.c:ROL Unexecuted instantiation: crypt_find_hash.c:ROL Unexecuted instantiation: crypt_hash_descriptor.c:ROL Unexecuted instantiation: crypt_hash_is_valid.c:ROL Unexecuted instantiation: crypt_ltc_mp_descriptor.c:ROL Unexecuted instantiation: crypt_register_cipher.c:ROL Unexecuted instantiation: crypt_register_hash.c:ROL Unexecuted instantiation: crypt_register_prng.c:ROL Unexecuted instantiation: zeromem.c:ROL Unexecuted instantiation: ctr_decrypt.c:ROL Unexecuted instantiation: ctr_encrypt.c:ROL Unexecuted instantiation: ctr_start.c:ROL Unexecuted instantiation: ecc_ansi_x963_export.c:ROL Unexecuted instantiation: ecc_free.c:ROL Unexecuted instantiation: ecc_make_key.c:ROL Unexecuted instantiation: ltc_ecc_is_valid_idx.c:ROL Unexecuted instantiation: ltc_ecc_map.c:ROL Unexecuted instantiation: ltc_ecc_mul2add.c:ROL Unexecuted instantiation: ltc_ecc_mulmod_timing.c:ROL Unexecuted instantiation: ltc_ecc_points.c:ROL Unexecuted instantiation: ltc_ecc_projective_add_point.c:ROL Unexecuted instantiation: ltc_ecc_projective_dbl_point.c:ROL Unexecuted instantiation: chacha_crypt.c:ROL Unexecuted instantiation: chacha_ivctr64.c:ROL Unexecuted instantiation: chacha_keystream.c:ROL Unexecuted instantiation: chacha_setup.c:ROL Unexecuted instantiation: hash_memory.c:ROL Unexecuted instantiation: crypt_cipher_descriptor.c:ROL Unexecuted instantiation: crypt_cipher_is_valid.c:ROL Unexecuted instantiation: crypt_prng_descriptor.c:ROL Unexecuted instantiation: crypt_prng_is_valid.c:ROL |
264 | | |
265 | | static inline ulong32 ROR(ulong32 word, int i) |
266 | 0 | { |
267 | 0 | asm ("rorl %%cl,%0" |
268 | 0 | :"=r" (word) |
269 | 0 | :"0" (word),"c" (i)); |
270 | 0 | return word; |
271 | 0 | } Unexecuted instantiation: fuzzer-kexmlkem-cli.c:ROR Unexecuted instantiation: dbutil.c:ROR Unexecuted instantiation: buffer.c:ROR Unexecuted instantiation: dbhelpers.c:ROR Unexecuted instantiation: dss.c:ROR Unexecuted instantiation: bignum.c:ROR Unexecuted instantiation: signkey.c:ROR Unexecuted instantiation: rsa.c:ROR Unexecuted instantiation: dbrandom.c:ROR Unexecuted instantiation: queue.c:ROR Unexecuted instantiation: atomicio.c:ROR Unexecuted instantiation: compat.c:ROR Unexecuted instantiation: fake-rfc2553.c:ROR Unexecuted instantiation: ltc_prng.c:ROR Unexecuted instantiation: ecc.c:ROR Unexecuted instantiation: ecdsa.c:ROR Unexecuted instantiation: sk-ecdsa.c:ROR Unexecuted instantiation: crypto_desc.c:ROR Unexecuted instantiation: curve25519.c:ROR Unexecuted instantiation: ed25519.c:ROR Unexecuted instantiation: sk-ed25519.c:ROR Unexecuted instantiation: dbmalloc.c:ROR Unexecuted instantiation: gensignkey.c:ROR Unexecuted instantiation: gendss.c:ROR Unexecuted instantiation: genrsa.c:ROR Unexecuted instantiation: gened25519.c:ROR Unexecuted instantiation: fuzz-common.c:ROR Unexecuted instantiation: fuzz-wrapfd.c:ROR Unexecuted instantiation: common-session.c:ROR Unexecuted instantiation: packet.c:ROR Unexecuted instantiation: common-algo.c:ROR Unexecuted instantiation: common-kex.c:ROR Unexecuted instantiation: common-channel.c:ROR Unexecuted instantiation: common-chansession.c:ROR Unexecuted instantiation: termcodes.c:ROR Unexecuted instantiation: loginrec.c:ROR Unexecuted instantiation: tcp-accept.c:ROR Unexecuted instantiation: listener.c:ROR Unexecuted instantiation: process-packet.c:ROR Unexecuted instantiation: common-runopts.c:ROR Unexecuted instantiation: circbuffer.c:ROR Unexecuted instantiation: list.c:ROR Unexecuted instantiation: netio.c:ROR Unexecuted instantiation: chachapoly.c:ROR Unexecuted instantiation: gcm.c:ROR Unexecuted instantiation: kex-x25519.c:ROR Unexecuted instantiation: kex-dh.c:ROR Unexecuted instantiation: kex-ecdh.c:ROR Unexecuted instantiation: kex-pqhybrid.c:ROR Unexecuted instantiation: sntrup761.c:ROR Unexecuted instantiation: mlkem768.c:ROR Unexecuted instantiation: cli-auth.c:ROR Unexecuted instantiation: cli-authpasswd.c:ROR Unexecuted instantiation: cli-kex.c:ROR Unexecuted instantiation: cli-session.c:ROR Unexecuted instantiation: cli-runopts.c:ROR Unexecuted instantiation: cli-chansession.c:ROR Unexecuted instantiation: cli-authpubkey.c:ROR Unexecuted instantiation: cli-tcpfwd.c:ROR Unexecuted instantiation: cli-channel.c:ROR Unexecuted instantiation: cli-authinteract.c:ROR Unexecuted instantiation: cli-agentfwd.c:ROR Unexecuted instantiation: cli-readconf.c:ROR Unexecuted instantiation: svr-kex.c:ROR Unexecuted instantiation: svr-auth.c:ROR Unexecuted instantiation: sshpty.c:ROR Unexecuted instantiation: svr-authpasswd.c:ROR Unexecuted instantiation: svr-authpubkey.c:ROR Unexecuted instantiation: svr-authpubkeyoptions.c:ROR Unexecuted instantiation: svr-session.c:ROR Unexecuted instantiation: svr-service.c:ROR Unexecuted instantiation: svr-chansession.c:ROR Unexecuted instantiation: svr-runopts.c:ROR Unexecuted instantiation: svr-agentfwd.c:ROR Unexecuted instantiation: svr-x11fwd.c:ROR Unexecuted instantiation: svr-tcpfwd.c:ROR Unexecuted instantiation: svr-authpam.c:ROR Unexecuted instantiation: aes.c:ROR Unexecuted instantiation: sha1.c:ROR Unexecuted instantiation: sha256.c:ROR Unexecuted instantiation: sha384.c:ROR Unexecuted instantiation: sha512.c:ROR Unexecuted instantiation: hmac_done.c:ROR Unexecuted instantiation: hmac_init.c:ROR Unexecuted instantiation: hmac_process.c:ROR Unexecuted instantiation: poly1305.c:ROR Unexecuted instantiation: ltm_desc.c:ROR Unexecuted instantiation: multi.c:ROR Unexecuted instantiation: base64_decode.c:ROR Unexecuted instantiation: base64_encode.c:ROR Unexecuted instantiation: crypt_argchk.c:ROR Unexecuted instantiation: crypt_find_cipher.c:ROR Unexecuted instantiation: crypt_find_hash.c:ROR Unexecuted instantiation: crypt_hash_descriptor.c:ROR Unexecuted instantiation: crypt_hash_is_valid.c:ROR Unexecuted instantiation: crypt_ltc_mp_descriptor.c:ROR Unexecuted instantiation: crypt_register_cipher.c:ROR Unexecuted instantiation: crypt_register_hash.c:ROR Unexecuted instantiation: crypt_register_prng.c:ROR Unexecuted instantiation: zeromem.c:ROR Unexecuted instantiation: ctr_decrypt.c:ROR Unexecuted instantiation: ctr_encrypt.c:ROR Unexecuted instantiation: ctr_start.c:ROR Unexecuted instantiation: ecc_ansi_x963_export.c:ROR Unexecuted instantiation: ecc_free.c:ROR Unexecuted instantiation: ecc_make_key.c:ROR Unexecuted instantiation: ltc_ecc_is_valid_idx.c:ROR Unexecuted instantiation: ltc_ecc_map.c:ROR Unexecuted instantiation: ltc_ecc_mul2add.c:ROR Unexecuted instantiation: ltc_ecc_mulmod_timing.c:ROR Unexecuted instantiation: ltc_ecc_points.c:ROR Unexecuted instantiation: ltc_ecc_projective_add_point.c:ROR Unexecuted instantiation: ltc_ecc_projective_dbl_point.c:ROR Unexecuted instantiation: chacha_crypt.c:ROR Unexecuted instantiation: chacha_ivctr64.c:ROR Unexecuted instantiation: chacha_keystream.c:ROR Unexecuted instantiation: chacha_setup.c:ROR Unexecuted instantiation: hash_memory.c:ROR Unexecuted instantiation: crypt_cipher_descriptor.c:ROR Unexecuted instantiation: crypt_cipher_is_valid.c:ROR Unexecuted instantiation: crypt_prng_descriptor.c:ROR Unexecuted instantiation: crypt_prng_is_valid.c:ROR |
272 | | |
273 | | #ifndef LTC_NO_ROLC |
274 | | |
275 | 0 | #define ROLc(word,i) ({ \ |
276 | 0 | ulong32 __ROLc_tmp = (word); \ |
277 | 0 | __asm__ ("roll %2, %0" : \ |
278 | 0 | "=r" (__ROLc_tmp) : \ |
279 | 0 | "0" (__ROLc_tmp), \ |
280 | 0 | "I" (i)); \ |
281 | 0 | __ROLc_tmp; \ |
282 | 0 | }) |
283 | 542k | #define RORc(word,i) ({ \ |
284 | 542k | ulong32 __RORc_tmp = (word); \ |
285 | 542k | __asm__ ("rorl %2, %0" : \ |
286 | 542k | "=r" (__RORc_tmp) : \ |
287 | 542k | "0" (__RORc_tmp), \ |
288 | 542k | "I" (i)); \ |
289 | 542k | __RORc_tmp; \ |
290 | 542k | }) |
291 | | |
292 | | #else |
293 | | |
294 | | #define ROLc ROL |
295 | | #define RORc ROR |
296 | | |
297 | | #endif |
298 | | |
299 | | #elif !defined(__STRICT_ANSI__) && defined(LTC_PPC32) |
300 | | #define LTC_ROx_ASM |
301 | | |
302 | | static inline ulong32 ROL(ulong32 word, int i) |
303 | | { |
304 | | asm ("rotlw %0,%0,%2" |
305 | | :"=r" (word) |
306 | | :"0" (word),"r" (i)); |
307 | | return word; |
308 | | } |
309 | | |
310 | | static inline ulong32 ROR(ulong32 word, int i) |
311 | | { |
312 | | asm ("rotlw %0,%0,%2" |
313 | | :"=r" (word) |
314 | | :"0" (word),"r" (32-i)); |
315 | | return word; |
316 | | } |
317 | | |
318 | | #ifndef LTC_NO_ROLC |
319 | | |
320 | | static inline ulong32 ROLc(ulong32 word, const int i) |
321 | | { |
322 | | asm ("rotlwi %0,%0,%2" |
323 | | :"=r" (word) |
324 | | :"0" (word),"I" (i)); |
325 | | return word; |
326 | | } |
327 | | |
328 | | static inline ulong32 RORc(ulong32 word, const int i) |
329 | | { |
330 | | asm ("rotrwi %0,%0,%2" |
331 | | :"=r" (word) |
332 | | :"0" (word),"I" (i)); |
333 | | return word; |
334 | | } |
335 | | |
336 | | #else |
337 | | |
338 | | #define ROLc ROL |
339 | | #define RORc ROR |
340 | | |
341 | | #endif |
342 | | |
343 | | |
344 | | #else |
345 | | |
346 | | /* rotates the hard way */ |
347 | | #define ROL(x, y) ( (((ulong32)(x)<<(ulong32)((y)&31)) | (((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)((32-((y)&31))&31))) & 0xFFFFFFFFUL) |
348 | | #define ROR(x, y) ( ((((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)((y)&31)) | ((ulong32)(x)<<(ulong32)((32-((y)&31))&31))) & 0xFFFFFFFFUL) |
349 | | #define ROLc(x, y) ( (((ulong32)(x)<<(ulong32)((y)&31)) | (((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)((32-((y)&31))&31))) & 0xFFFFFFFFUL) |
350 | | #define RORc(x, y) ( ((((ulong32)(x)&0xFFFFFFFFUL)>>(ulong32)((y)&31)) | ((ulong32)(x)<<(ulong32)((32-((y)&31))&31))) & 0xFFFFFFFFUL) |
351 | | |
352 | | #endif |
353 | | |
354 | | |
355 | | /* 64-bit Rotates */ |
356 | | #if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(_WIN64) && !defined(LTC_NO_ASM) |
357 | | |
358 | | static inline ulong64 ROL64(ulong64 word, int i) |
359 | 0 | { |
360 | 0 | asm("rolq %%cl,%0" |
361 | 0 | :"=r" (word) |
362 | 0 | :"0" (word),"c" (i)); |
363 | 0 | return word; |
364 | 0 | } Unexecuted instantiation: fuzzer-kexmlkem-cli.c:ROL64 Unexecuted instantiation: dbutil.c:ROL64 Unexecuted instantiation: buffer.c:ROL64 Unexecuted instantiation: dbhelpers.c:ROL64 Unexecuted instantiation: dss.c:ROL64 Unexecuted instantiation: bignum.c:ROL64 Unexecuted instantiation: signkey.c:ROL64 Unexecuted instantiation: rsa.c:ROL64 Unexecuted instantiation: dbrandom.c:ROL64 Unexecuted instantiation: queue.c:ROL64 Unexecuted instantiation: atomicio.c:ROL64 Unexecuted instantiation: compat.c:ROL64 Unexecuted instantiation: fake-rfc2553.c:ROL64 Unexecuted instantiation: ltc_prng.c:ROL64 Unexecuted instantiation: ecc.c:ROL64 Unexecuted instantiation: ecdsa.c:ROL64 Unexecuted instantiation: sk-ecdsa.c:ROL64 Unexecuted instantiation: crypto_desc.c:ROL64 Unexecuted instantiation: curve25519.c:ROL64 Unexecuted instantiation: ed25519.c:ROL64 Unexecuted instantiation: sk-ed25519.c:ROL64 Unexecuted instantiation: dbmalloc.c:ROL64 Unexecuted instantiation: gensignkey.c:ROL64 Unexecuted instantiation: gendss.c:ROL64 Unexecuted instantiation: genrsa.c:ROL64 Unexecuted instantiation: gened25519.c:ROL64 Unexecuted instantiation: fuzz-common.c:ROL64 Unexecuted instantiation: fuzz-wrapfd.c:ROL64 Unexecuted instantiation: common-session.c:ROL64 Unexecuted instantiation: packet.c:ROL64 Unexecuted instantiation: common-algo.c:ROL64 Unexecuted instantiation: common-kex.c:ROL64 Unexecuted instantiation: common-channel.c:ROL64 Unexecuted instantiation: common-chansession.c:ROL64 Unexecuted instantiation: termcodes.c:ROL64 Unexecuted instantiation: loginrec.c:ROL64 Unexecuted instantiation: tcp-accept.c:ROL64 Unexecuted instantiation: listener.c:ROL64 Unexecuted instantiation: process-packet.c:ROL64 Unexecuted instantiation: common-runopts.c:ROL64 Unexecuted instantiation: circbuffer.c:ROL64 Unexecuted instantiation: list.c:ROL64 Unexecuted instantiation: netio.c:ROL64 Unexecuted instantiation: chachapoly.c:ROL64 Unexecuted instantiation: gcm.c:ROL64 Unexecuted instantiation: kex-x25519.c:ROL64 Unexecuted instantiation: kex-dh.c:ROL64 Unexecuted instantiation: kex-ecdh.c:ROL64 Unexecuted instantiation: kex-pqhybrid.c:ROL64 Unexecuted instantiation: sntrup761.c:ROL64 Unexecuted instantiation: mlkem768.c:ROL64 Unexecuted instantiation: cli-auth.c:ROL64 Unexecuted instantiation: cli-authpasswd.c:ROL64 Unexecuted instantiation: cli-kex.c:ROL64 Unexecuted instantiation: cli-session.c:ROL64 Unexecuted instantiation: cli-runopts.c:ROL64 Unexecuted instantiation: cli-chansession.c:ROL64 Unexecuted instantiation: cli-authpubkey.c:ROL64 Unexecuted instantiation: cli-tcpfwd.c:ROL64 Unexecuted instantiation: cli-channel.c:ROL64 Unexecuted instantiation: cli-authinteract.c:ROL64 Unexecuted instantiation: cli-agentfwd.c:ROL64 Unexecuted instantiation: cli-readconf.c:ROL64 Unexecuted instantiation: svr-kex.c:ROL64 Unexecuted instantiation: svr-auth.c:ROL64 Unexecuted instantiation: sshpty.c:ROL64 Unexecuted instantiation: svr-authpasswd.c:ROL64 Unexecuted instantiation: svr-authpubkey.c:ROL64 Unexecuted instantiation: svr-authpubkeyoptions.c:ROL64 Unexecuted instantiation: svr-session.c:ROL64 Unexecuted instantiation: svr-service.c:ROL64 Unexecuted instantiation: svr-chansession.c:ROL64 Unexecuted instantiation: svr-runopts.c:ROL64 Unexecuted instantiation: svr-agentfwd.c:ROL64 Unexecuted instantiation: svr-x11fwd.c:ROL64 Unexecuted instantiation: svr-tcpfwd.c:ROL64 Unexecuted instantiation: svr-authpam.c:ROL64 Unexecuted instantiation: aes.c:ROL64 Unexecuted instantiation: sha1.c:ROL64 Unexecuted instantiation: sha256.c:ROL64 Unexecuted instantiation: sha384.c:ROL64 Unexecuted instantiation: sha512.c:ROL64 Unexecuted instantiation: hmac_done.c:ROL64 Unexecuted instantiation: hmac_init.c:ROL64 Unexecuted instantiation: hmac_process.c:ROL64 Unexecuted instantiation: poly1305.c:ROL64 Unexecuted instantiation: ltm_desc.c:ROL64 Unexecuted instantiation: multi.c:ROL64 Unexecuted instantiation: base64_decode.c:ROL64 Unexecuted instantiation: base64_encode.c:ROL64 Unexecuted instantiation: crypt_argchk.c:ROL64 Unexecuted instantiation: crypt_find_cipher.c:ROL64 Unexecuted instantiation: crypt_find_hash.c:ROL64 Unexecuted instantiation: crypt_hash_descriptor.c:ROL64 Unexecuted instantiation: crypt_hash_is_valid.c:ROL64 Unexecuted instantiation: crypt_ltc_mp_descriptor.c:ROL64 Unexecuted instantiation: crypt_register_cipher.c:ROL64 Unexecuted instantiation: crypt_register_hash.c:ROL64 Unexecuted instantiation: crypt_register_prng.c:ROL64 Unexecuted instantiation: zeromem.c:ROL64 Unexecuted instantiation: ctr_decrypt.c:ROL64 Unexecuted instantiation: ctr_encrypt.c:ROL64 Unexecuted instantiation: ctr_start.c:ROL64 Unexecuted instantiation: ecc_ansi_x963_export.c:ROL64 Unexecuted instantiation: ecc_free.c:ROL64 Unexecuted instantiation: ecc_make_key.c:ROL64 Unexecuted instantiation: ltc_ecc_is_valid_idx.c:ROL64 Unexecuted instantiation: ltc_ecc_map.c:ROL64 Unexecuted instantiation: ltc_ecc_mul2add.c:ROL64 Unexecuted instantiation: ltc_ecc_mulmod_timing.c:ROL64 Unexecuted instantiation: ltc_ecc_points.c:ROL64 Unexecuted instantiation: ltc_ecc_projective_add_point.c:ROL64 Unexecuted instantiation: ltc_ecc_projective_dbl_point.c:ROL64 Unexecuted instantiation: chacha_crypt.c:ROL64 Unexecuted instantiation: chacha_ivctr64.c:ROL64 Unexecuted instantiation: chacha_keystream.c:ROL64 Unexecuted instantiation: chacha_setup.c:ROL64 Unexecuted instantiation: hash_memory.c:ROL64 Unexecuted instantiation: crypt_cipher_descriptor.c:ROL64 Unexecuted instantiation: crypt_cipher_is_valid.c:ROL64 Unexecuted instantiation: crypt_prng_descriptor.c:ROL64 Unexecuted instantiation: crypt_prng_is_valid.c:ROL64 |
365 | | |
366 | | static inline ulong64 ROR64(ulong64 word, int i) |
367 | 0 | { |
368 | 0 | asm("rorq %%cl,%0" |
369 | 0 | :"=r" (word) |
370 | 0 | :"0" (word),"c" (i)); |
371 | 0 | return word; |
372 | 0 | } Unexecuted instantiation: fuzzer-kexmlkem-cli.c:ROR64 Unexecuted instantiation: dbutil.c:ROR64 Unexecuted instantiation: buffer.c:ROR64 Unexecuted instantiation: dbhelpers.c:ROR64 Unexecuted instantiation: dss.c:ROR64 Unexecuted instantiation: bignum.c:ROR64 Unexecuted instantiation: signkey.c:ROR64 Unexecuted instantiation: rsa.c:ROR64 Unexecuted instantiation: dbrandom.c:ROR64 Unexecuted instantiation: queue.c:ROR64 Unexecuted instantiation: atomicio.c:ROR64 Unexecuted instantiation: compat.c:ROR64 Unexecuted instantiation: fake-rfc2553.c:ROR64 Unexecuted instantiation: ltc_prng.c:ROR64 Unexecuted instantiation: ecc.c:ROR64 Unexecuted instantiation: ecdsa.c:ROR64 Unexecuted instantiation: sk-ecdsa.c:ROR64 Unexecuted instantiation: crypto_desc.c:ROR64 Unexecuted instantiation: curve25519.c:ROR64 Unexecuted instantiation: ed25519.c:ROR64 Unexecuted instantiation: sk-ed25519.c:ROR64 Unexecuted instantiation: dbmalloc.c:ROR64 Unexecuted instantiation: gensignkey.c:ROR64 Unexecuted instantiation: gendss.c:ROR64 Unexecuted instantiation: genrsa.c:ROR64 Unexecuted instantiation: gened25519.c:ROR64 Unexecuted instantiation: fuzz-common.c:ROR64 Unexecuted instantiation: fuzz-wrapfd.c:ROR64 Unexecuted instantiation: common-session.c:ROR64 Unexecuted instantiation: packet.c:ROR64 Unexecuted instantiation: common-algo.c:ROR64 Unexecuted instantiation: common-kex.c:ROR64 Unexecuted instantiation: common-channel.c:ROR64 Unexecuted instantiation: common-chansession.c:ROR64 Unexecuted instantiation: termcodes.c:ROR64 Unexecuted instantiation: loginrec.c:ROR64 Unexecuted instantiation: tcp-accept.c:ROR64 Unexecuted instantiation: listener.c:ROR64 Unexecuted instantiation: process-packet.c:ROR64 Unexecuted instantiation: common-runopts.c:ROR64 Unexecuted instantiation: circbuffer.c:ROR64 Unexecuted instantiation: list.c:ROR64 Unexecuted instantiation: netio.c:ROR64 Unexecuted instantiation: chachapoly.c:ROR64 Unexecuted instantiation: gcm.c:ROR64 Unexecuted instantiation: kex-x25519.c:ROR64 Unexecuted instantiation: kex-dh.c:ROR64 Unexecuted instantiation: kex-ecdh.c:ROR64 Unexecuted instantiation: kex-pqhybrid.c:ROR64 Unexecuted instantiation: sntrup761.c:ROR64 Unexecuted instantiation: mlkem768.c:ROR64 Unexecuted instantiation: cli-auth.c:ROR64 Unexecuted instantiation: cli-authpasswd.c:ROR64 Unexecuted instantiation: cli-kex.c:ROR64 Unexecuted instantiation: cli-session.c:ROR64 Unexecuted instantiation: cli-runopts.c:ROR64 Unexecuted instantiation: cli-chansession.c:ROR64 Unexecuted instantiation: cli-authpubkey.c:ROR64 Unexecuted instantiation: cli-tcpfwd.c:ROR64 Unexecuted instantiation: cli-channel.c:ROR64 Unexecuted instantiation: cli-authinteract.c:ROR64 Unexecuted instantiation: cli-agentfwd.c:ROR64 Unexecuted instantiation: cli-readconf.c:ROR64 Unexecuted instantiation: svr-kex.c:ROR64 Unexecuted instantiation: svr-auth.c:ROR64 Unexecuted instantiation: sshpty.c:ROR64 Unexecuted instantiation: svr-authpasswd.c:ROR64 Unexecuted instantiation: svr-authpubkey.c:ROR64 Unexecuted instantiation: svr-authpubkeyoptions.c:ROR64 Unexecuted instantiation: svr-session.c:ROR64 Unexecuted instantiation: svr-service.c:ROR64 Unexecuted instantiation: svr-chansession.c:ROR64 Unexecuted instantiation: svr-runopts.c:ROR64 Unexecuted instantiation: svr-agentfwd.c:ROR64 Unexecuted instantiation: svr-x11fwd.c:ROR64 Unexecuted instantiation: svr-tcpfwd.c:ROR64 Unexecuted instantiation: svr-authpam.c:ROR64 Unexecuted instantiation: aes.c:ROR64 Unexecuted instantiation: sha1.c:ROR64 Unexecuted instantiation: sha256.c:ROR64 Unexecuted instantiation: sha384.c:ROR64 Unexecuted instantiation: sha512.c:ROR64 Unexecuted instantiation: hmac_done.c:ROR64 Unexecuted instantiation: hmac_init.c:ROR64 Unexecuted instantiation: hmac_process.c:ROR64 Unexecuted instantiation: poly1305.c:ROR64 Unexecuted instantiation: ltm_desc.c:ROR64 Unexecuted instantiation: multi.c:ROR64 Unexecuted instantiation: base64_decode.c:ROR64 Unexecuted instantiation: base64_encode.c:ROR64 Unexecuted instantiation: crypt_argchk.c:ROR64 Unexecuted instantiation: crypt_find_cipher.c:ROR64 Unexecuted instantiation: crypt_find_hash.c:ROR64 Unexecuted instantiation: crypt_hash_descriptor.c:ROR64 Unexecuted instantiation: crypt_hash_is_valid.c:ROR64 Unexecuted instantiation: crypt_ltc_mp_descriptor.c:ROR64 Unexecuted instantiation: crypt_register_cipher.c:ROR64 Unexecuted instantiation: crypt_register_hash.c:ROR64 Unexecuted instantiation: crypt_register_prng.c:ROR64 Unexecuted instantiation: zeromem.c:ROR64 Unexecuted instantiation: ctr_decrypt.c:ROR64 Unexecuted instantiation: ctr_encrypt.c:ROR64 Unexecuted instantiation: ctr_start.c:ROR64 Unexecuted instantiation: ecc_ansi_x963_export.c:ROR64 Unexecuted instantiation: ecc_free.c:ROR64 Unexecuted instantiation: ecc_make_key.c:ROR64 Unexecuted instantiation: ltc_ecc_is_valid_idx.c:ROR64 Unexecuted instantiation: ltc_ecc_map.c:ROR64 Unexecuted instantiation: ltc_ecc_mul2add.c:ROR64 Unexecuted instantiation: ltc_ecc_mulmod_timing.c:ROR64 Unexecuted instantiation: ltc_ecc_points.c:ROR64 Unexecuted instantiation: ltc_ecc_projective_add_point.c:ROR64 Unexecuted instantiation: ltc_ecc_projective_dbl_point.c:ROR64 Unexecuted instantiation: chacha_crypt.c:ROR64 Unexecuted instantiation: chacha_ivctr64.c:ROR64 Unexecuted instantiation: chacha_keystream.c:ROR64 Unexecuted instantiation: chacha_setup.c:ROR64 Unexecuted instantiation: hash_memory.c:ROR64 Unexecuted instantiation: crypt_cipher_descriptor.c:ROR64 Unexecuted instantiation: crypt_cipher_is_valid.c:ROR64 Unexecuted instantiation: crypt_prng_descriptor.c:ROR64 Unexecuted instantiation: crypt_prng_is_valid.c:ROR64 |
373 | | |
374 | | #ifndef LTC_NO_ROLC |
375 | | |
376 | | #define ROL64c(word,i) ({ \ |
377 | | ulong64 __ROL64c_tmp = word; \ |
378 | | __asm__ ("rolq %2, %0" : \ |
379 | | "=r" (__ROL64c_tmp) : \ |
380 | | "0" (__ROL64c_tmp), \ |
381 | | "J" (i)); \ |
382 | | __ROL64c_tmp; \ |
383 | | }) |
384 | 0 | #define ROR64c(word,i) ({ \ |
385 | 0 | ulong64 __ROR64c_tmp = word; \ |
386 | 0 | __asm__ ("rorq %2, %0" : \ |
387 | 0 | "=r" (__ROR64c_tmp) : \ |
388 | 0 | "0" (__ROR64c_tmp), \ |
389 | 0 | "J" (i)); \ |
390 | 0 | __ROR64c_tmp; \ |
391 | 0 | }) |
392 | | |
393 | | #else /* LTC_NO_ROLC */ |
394 | | |
395 | | #define ROL64c ROL64 |
396 | | #define ROR64c ROR64 |
397 | | |
398 | | #endif |
399 | | |
400 | | #else /* Not x86_64 */ |
401 | | |
402 | | #define ROL64(x, y) \ |
403 | | ( (((x)<<((ulong64)(y)&63)) | \ |
404 | | (((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>(((ulong64)64-((y)&63))&63))) & CONST64(0xFFFFFFFFFFFFFFFF)) |
405 | | |
406 | | #define ROR64(x, y) \ |
407 | | ( ((((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)(y)&CONST64(63))) | \ |
408 | | ((x)<<(((ulong64)64-((y)&63))&63))) & CONST64(0xFFFFFFFFFFFFFFFF)) |
409 | | |
410 | | #define ROL64c(x, y) \ |
411 | | ( (((x)<<((ulong64)(y)&63)) | \ |
412 | | (((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>(((ulong64)64-((y)&63))&63))) & CONST64(0xFFFFFFFFFFFFFFFF)) |
413 | | |
414 | | #define ROR64c(x, y) \ |
415 | | ( ((((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)(y)&CONST64(63))) | \ |
416 | | ((x)<<(((ulong64)64-((y)&63))&63))) & CONST64(0xFFFFFFFFFFFFFFFF)) |
417 | | |
418 | | #endif |
419 | | |
420 | | #ifndef MAX |
421 | 0 | #define MAX(x, y) ( ((x)>(y))?(x):(y) ) |
422 | | #endif |
423 | | |
424 | | #ifndef MIN |
425 | 1.85k | #define MIN(x, y) ( ((x)<(y))?(x):(y) ) |
426 | | #endif |
427 | | |
428 | | #ifndef LTC_UNUSED_PARAM |
429 | 0 | #define LTC_UNUSED_PARAM(x) (void)(x) |
430 | | #endif |
431 | | |
432 | | /* extract a byte portably */ |
433 | | #ifdef _MSC_VER |
434 | | #define byte(x, n) ((unsigned char)((x) >> (8 * (n)))) |
435 | | #else |
436 | 0 | #define byte(x, n) (((x) >> (8 * (n))) & 255) |
437 | | #endif |
438 | | |
439 | | /* there is no snprintf before Visual C++ 2015 */ |
440 | | #if defined(_MSC_VER) && _MSC_VER < 1900 |
441 | | #define snprintf _snprintf |
442 | | #endif |
443 | | |
444 | | /* ref: $Format:%D$ */ |
445 | | /* git commit: $Format:%H$ */ |
446 | | /* commit time: $Format:%ai$ */ |