Raven Core  3.0.0
P2P Digital Currency
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Macros | Typedefs
sph_types.h File Reference

Basic type definitions. More...

#include <limits.h>
Include dependency graph for sph_types.h:
This graph shows which files directly or indirectly include this file:

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
 

Detailed Description

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)=============================

Author
Thomas Pornin thoma.nosp@m.s.po.nosp@m.rnin@.nosp@m.cryp.nosp@m.tolog.nosp@m..com

Definition in file sph_types.h.

Macro Definition Documentation

◆ SPH_C32

#define SPH_C32 (   x)    ((sph_u32)(x ## UL))

Definition at line 873 of file sph_types.h.

◆ SPH_INLINE

#define SPH_INLINE

Definition at line 954 of file sph_types.h.

◆ SPH_ROTL32

#define SPH_ROTL32 (   x,
 
)    SPH_T32(((x) << (n)) | ((x) >> (32 - (n))))

Definition at line 933 of file sph_types.h.

◆ SPH_ROTR32

#define SPH_ROTR32 (   x,
 
)    SPH_ROTL32(x, (32 - (n)))

Definition at line 934 of file sph_types.h.

◆ SPH_T32

#define SPH_T32 (   x)    ((x) & SPH_C32(0xFFFFFFFF))

Definition at line 932 of file sph_types.h.

Typedef Documentation

◆ sph_s32

typedef long sph_s32

Definition at line 871 of file sph_types.h.

◆ sph_u32

typedef unsigned long sph_u32

Definition at line 870 of file sph_types.h.