Raven Core
3.0.0
P2P Digital Currency
|
Basic type definitions. More...
#include <limits.h>
Go to the source code of this file.
Macros | |
#define | SPH_C32(x) ((sph_u32)(x ## UL)) |
#define | SPH_T32(x) ((x) & SPH_C32(0xFFFFFFFF)) |
#define | SPH_ROTL32(x, n) SPH_T32(((x) << (n)) | ((x) >> (32 - (n)))) |
#define | SPH_ROTR32(x, n) SPH_ROTL32(x, (32 - (n))) |
#define | SPH_INLINE |
Typedefs | |
typedef unsigned long | sph_u32 |
typedef long | sph_s32 |
Basic type definitions.
This header file defines the generic integer types that will be used for the implementation of hash functions; it also contains helper functions which encode and decode multi-byte integer values, using either little-endian or big-endian conventions.
This file contains a compile-time test on the size of a byte (the unsigned char
C type). If bytes are not octets, i.e. if they do not have a size of exactly 8 bits, then compilation is aborted. Architectures where bytes are not octets are relatively rare, even in the embedded devices market. We forbid non-octet bytes because there is no clear convention on how octet streams are encoded on such systems.
==========================(LICENSE BEGIN)============================
Copyright (c) 2007-2010 Projet RNRT SAPHIR
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
===========================(LICENSE END)=============================
Definition in file sph_types.h.
#define SPH_C32 | ( | x | ) | ((sph_u32)(x ## UL)) |
Definition at line 873 of file sph_types.h.
#define SPH_INLINE |
Definition at line 954 of file sph_types.h.
#define SPH_ROTL32 | ( | x, | |
n | |||
) | SPH_T32(((x) << (n)) | ((x) >> (32 - (n)))) |
Definition at line 933 of file sph_types.h.
#define SPH_ROTR32 | ( | x, | |
n | |||
) | SPH_ROTL32(x, (32 - (n))) |
Definition at line 934 of file sph_types.h.
#define SPH_T32 | ( | x | ) | ((x) & SPH_C32(0xFFFFFFFF)) |
Definition at line 932 of file sph_types.h.
typedef long sph_s32 |
Definition at line 871 of file sph_types.h.
typedef unsigned long sph_u32 |
Definition at line 870 of file sph_types.h.