diff options
Diffstat (limited to 'linden/indra/libgcrypt/libgcrypt-1.2.2/cipher/bithelp.h')
-rw-r--r--[-rwxr-xr-x] | linden/indra/libgcrypt/libgcrypt-1.2.2/cipher/bithelp.h | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/cipher/bithelp.h b/linden/indra/libgcrypt/libgcrypt-1.2.2/cipher/bithelp.h index 8062b45..1505324 100755..100644 --- a/linden/indra/libgcrypt/libgcrypt-1.2.2/cipher/bithelp.h +++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/cipher/bithelp.h | |||
@@ -1,54 +1,54 @@ | |||
1 | /* bithelp.h - Some bit manipulation helpers | 1 | /* bithelp.h - Some bit manipulation helpers |
2 | * Copyright (C) 1999, 2002 Free Software Foundation, Inc. | 2 | * Copyright (C) 1999, 2002 Free Software Foundation, Inc. |
3 | * | 3 | * |
4 | * This file is part of Libgcrypt. | 4 | * This file is part of Libgcrypt. |
5 | * | 5 | * |
6 | * Libgcrypt is free software; you can redistribute it and/or modify | 6 | * Libgcrypt is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU Lesser general Public License as | 7 | * it under the terms of the GNU Lesser general Public License as |
8 | * published by the Free Software Foundation; either version 2.1 of | 8 | * published by the Free Software Foundation; either version 2.1 of |
9 | * the License, or (at your option) any later version. | 9 | * the License, or (at your option) any later version. |
10 | * | 10 | * |
11 | * Libgcrypt is distributed in the hope that it will be useful, | 11 | * Libgcrypt is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU Lesser General Public License for more details. | 14 | * GNU Lesser General Public License for more details. |
15 | * | 15 | * |
16 | * You should have received a copy of the GNU Lesser General Public | 16 | * You should have received a copy of the GNU Lesser General Public |
17 | * License along with this program; if not, write to the Free Software | 17 | * License along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA | 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
19 | */ | 19 | */ |
20 | #ifndef G10_BITHELP_H | 20 | #ifndef G10_BITHELP_H |
21 | #define G10_BITHELP_H | 21 | #define G10_BITHELP_H |
22 | 22 | ||
23 | 23 | ||
24 | /**************** | 24 | /**************** |
25 | * Rotate the 32 bit unsigned integer X by N bits left/right | 25 | * Rotate the 32 bit unsigned integer X by N bits left/right |
26 | */ | 26 | */ |
27 | #if defined(__GNUC__) && defined(__i386__) | 27 | #if defined(__GNUC__) && defined(__i386__) |
28 | static inline u32 | 28 | static inline u32 |
29 | rol( u32 x, int n) | 29 | rol( u32 x, int n) |
30 | { | 30 | { |
31 | __asm__("roll %%cl,%0" | 31 | __asm__("roll %%cl,%0" |
32 | :"=r" (x) | 32 | :"=r" (x) |
33 | :"0" (x),"c" (n)); | 33 | :"0" (x),"c" (n)); |
34 | return x; | 34 | return x; |
35 | } | 35 | } |
36 | #else | 36 | #else |
37 | #define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) ) | 37 | #define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) ) |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #if defined(__GNUC__) && defined(__i386__) | 40 | #if defined(__GNUC__) && defined(__i386__) |
41 | static inline u32 | 41 | static inline u32 |
42 | ror(u32 x, int n) | 42 | ror(u32 x, int n) |
43 | { | 43 | { |
44 | __asm__("rorl %%cl,%0" | 44 | __asm__("rorl %%cl,%0" |
45 | :"=r" (x) | 45 | :"=r" (x) |
46 | :"0" (x),"c" (n)); | 46 | :"0" (x),"c" (n)); |
47 | return x; | 47 | return x; |
48 | } | 48 | } |
49 | #else | 49 | #else |
50 | #define ror(x,n) ( ((x) >> (n)) | ((x) << (32-(n))) ) | 50 | #define ror(x,n) ( ((x) >> (n)) | ((x) << (32-(n))) ) |
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | 53 | ||
54 | #endif /*G10_BITHELP_H*/ | 54 | #endif /*G10_BITHELP_H*/ |