Tor
0.4.9.2-alpha-dev
Toggle main menu visibility
Main Page
Related Pages
Modules
Data Structures
Data Structures
Data Structure Index
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerator
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
b
c
d
f
g
h
l
m
n
o
p
r
s
v
Enumerations
a
b
c
d
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerator
a
b
c
d
e
g
h
i
m
n
o
p
q
r
s
t
v
w
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
ext
byteorder.h
1
/* <MIT License>
2
Copyright (c) 2013-2014 Marek Majkowski <marek@popcount.org>
3
4
Permission is hereby granted, free of charge, to any person obtaining a copy
5
of this software and associated documentation files (the "Software"), to deal
6
in the Software without restriction, including without limitation the rights
7
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
copies of the Software, and to permit persons to whom the Software is
9
furnished to do so, subject to the following conditions:
10
11
The above copyright notice and this permission notice shall be included in
12
all copies or substantial portions of the Software.
13
14
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
THE SOFTWARE.
21
</MIT License>
22
23
Original location:
24
https://github.com/majek/csiphash/
25
26
Solution inspired by code from:
27
Samuel Neves (supercop/crypto_auth/siphash24/little)
28
djb (supercop/crypto_auth/siphash24/little2)
29
Jean-Philippe Aumasson (https://131002.net/siphash/siphash24.c)
30
*/
31
32
#ifdef HAVE_SYS_PARAM_H
33
#include <sys/param.h>
34
#endif
35
36
/* This code is extracted from csiphash.h */
37
38
#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
39
__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
40
# define _le64toh(x) ((uint64_t)(x))
41
#elif defined(_WIN32)
42
/* Windows is always little endian, unless you're on xbox360
43
http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.80).aspx */
44
# define _le64toh(x) ((uint64_t)(x))
45
#elif defined(__APPLE__)
46
# include <libkern/OSByteOrder.h>
47
# define _le64toh(x) OSSwapLittleToHostInt64(x)
48
#elif defined(sun) || defined(__sun)
49
# include <sys/byteorder.h>
50
# define _le64toh(x) LE_64(x)
51
52
#else
53
54
/* See: http://sourceforge.net/p/predef/wiki/Endianness/ */
55
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(OpenBSD)
56
# include <sys/endian.h>
57
# else
58
# include <endian.h>
59
# endif
60
# if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \
61
__BYTE_ORDER == __LITTLE_ENDIAN
62
# define _le64toh(x) ((uint64_t)(x))
63
# else
64
# if defined(OpenBSD)
65
# define _le64toh(x) letoh64(x)
66
# else
67
# define _le64toh(x) le64toh(x)
68
# endif
69
# endif
70
71
#endif
Generated by
1.9.4