Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nettle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Carlier
nettle
Commits
03bdd346
Commit
03bdd346
authored
15 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
(READ_UINT64, WRITE_UINT64): New macros.
Rev: nettle/macros.h:1.2
parent
e5462937
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
macros.h
+24
-1
24 additions, 1 deletion
macros.h
with
24 additions
and
1 deletion
macros.h
+
24
−
1
View file @
03bdd346
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
/* nettle, low-level cryptographics library
/* nettle, low-level cryptographics library
*
*
* Copyright (C) 2001 Niels Mller
* Copyright (C) 2001
, 2010
Niels Mller
*
*
* The nettle library is free software; you can redistribute it and/or modify
* The nettle library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* it under the terms of the GNU Lesser General Public License as published by
...
@@ -25,6 +25,29 @@
...
@@ -25,6 +25,29 @@
#ifndef NETTLE_MACROS_H_INCLUDED
#ifndef NETTLE_MACROS_H_INCLUDED
#define NETTLE_MACROS_H_INCLUDED
#define NETTLE_MACROS_H_INCLUDED
/* Reads a 64-bit integer, in network, big-endian, byte order */
#define READ_UINT64(p) \
( (((uint64_t) (p)[0]) << 56) \
| (((uint64_t) (p)[1]) << 48) \
| (((uint64_t) (p)[2]) << 40) \
| (((uint64_t) (p)[3]) << 32) \
| (((uint64_t) (p)[4]) << 24) \
| (((uint64_t) (p)[5]) << 16) \
| (((uint64_t) (p)[6]) << 8) \
| ((uint64_t) (p)[7]))
#define WRITE_UINT64(p, i) \
do { \
(p)[0] = ((i) >> 56) & 0xff; \
(p)[1] = ((i) >> 48) & 0xff; \
(p)[2] = ((i) >> 40) & 0xff; \
(p)[3] = ((i) >> 32) & 0xff; \
(p)[4] = ((i) >> 24) & 0xff; \
(p)[5] = ((i) >> 16) & 0xff; \
(p)[6] = ((i) >> 8) & 0xff; \
(p)[7] = (i) & 0xff; \
} while(0)
/* Reads a 32-bit integer, in network, big-endian, byte order */
/* Reads a 32-bit integer, in network, big-endian, byte order */
#define READ_UINT32(p) \
#define READ_UINT32(p) \
( (((uint32_t) (p)[0]) << 24) \
( (((uint32_t) (p)[0]) << 24) \
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment