1
/* This file was automatically imported with
2
import_gcry.py. Please don't modify it */
3
/* bithelp.h - Some bit manipulation helpers
4
* Copyright (C) 1999, 2002 Free Software Foundation, Inc.
6
* This file is part of Libgcrypt.
8
* Libgcrypt is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU Lesser general Public License as
10
* published by the Free Software Foundation; either version 2.1 of
11
* the License, or (at your option) any later version.
13
* Libgcrypt is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this program; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
27
* Rotate the 32 bit unsigned integer X by N bits left/right
29
#if defined(__GNUC__) && defined(__i386__)
33
__asm__("roll %%cl,%0"
39
#define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) )
42
#if defined(__GNUC__) && defined(__i386__)
46
__asm__("rorl %%cl,%0"
52
#define ror(x,n) ( ((x) >> (n)) | ((x) << (32-(n))) )
56
#endif /*G10_BITHELP_H*/