Common functions for manipulating unsigned 128bit integers on platforms without compiler support.
More...
Go to the source code of this file.
|
static uint128_t | uint128_add (uint128_t a, uint128_t b) |
| Add two 128bit unsigned integers. More...
|
|
static uint128_t | uint128_band (uint128_t a, uint128_t b) |
| Perform bitwise & of two 128bit unsigned integers. More...
|
|
static uint128_t | uint128_bor (uint128_t a, uint128_t b) |
| Perform bitwise | of two 128bit unsigned integers. More...
|
|
static uint128_t | uint128_decrement (uint128_t n) |
| Decrement a 128bit unsigned integer. More...
|
|
static bool | uint128_eq (uint128_t a, uint128_t b) |
| Return whether the integers are equal. More...
|
|
static uint128_t | uint128_gen_mask (uint8_t bits) |
| Create a 128 bit integer value with n bits high. More...
|
|
static bool | uint128_gt (uint128_t a, uint128_t b) |
| Return whether one integer is greater than the other. More...
|
|
static uint128_t | uint128_increment (uint128_t n) |
| Increment a 128bit unsigned integer. More...
|
|
static uint128_t | uint128_lshift (uint128_t num, uint8_t bits) |
| Left shift 128 bit integer. More...
|
|
static uint128_t | uint128_mul (uint128_t n, uint128_t m) |
| Multiply two unsigned 128bit integers. More...
|
|
static uint128_t | uint128_mul64 (uint64_t u, uint64_t v) |
| Multiply two unsigned 64bit integers to get an unsigned 128bit integer. More...
|
|
static uint128_t | uint128_new (uint64_t h, uint64_t l) |
| Creates a new uint128_t from a uint64_t. More...
|
|
static uint128_t | uint128_rshift (uint128_t num, uint8_t bits) |
| Right shift 128 bit integer. More...
|
|
static uint128_t | uint128_sub (uint128_t a, uint128_t b) |
| Subtract one 128bit integer from another. More...
|
|
static uint64_t | uint128_to_64 (uint128_t a) |
| Returns the low bits of a 128bit integer. More...
|
|
Common functions for manipulating unsigned 128bit integers on platforms without compiler support.
- Id
- 6acf0f34a2c358e843c2e98f610676cc24d36337
- Author
- Jacob F. W
-
Arran Cudbard-Bell
- Copyright
- 2019 Arran Cudbard-Bell (a.cud.nosp@m.bard.nosp@m.b@fre.nosp@m.erad.nosp@m.ius.o.nosp@m.rg)
-
2019 The FreeRADIUS server project
Definition in file uint128.h.
◆ uint128_add()
static uint128_t uint128_add |
( |
uint128_t |
a, |
|
|
uint128_t |
b |
|
) |
| |
|
inlinestatic |
Add two 128bit unsigned integers.
- Author
- Jacob F. W
Definition at line 115 of file uint128.h.
◆ uint128_band()
static uint128_t uint128_band |
( |
uint128_t |
a, |
|
|
uint128_t |
b |
|
) |
| |
|
inlinestatic |
Perform bitwise & of two 128bit unsigned integers.
Definition at line 228 of file uint128.h.
◆ uint128_bor()
static uint128_t uint128_bor |
( |
uint128_t |
a, |
|
|
uint128_t |
b |
|
) |
| |
|
inlinestatic |
Perform bitwise | of two 128bit unsigned integers.
Definition at line 239 of file uint128.h.
◆ uint128_decrement()
static uint128_t uint128_decrement |
( |
uint128_t |
n | ) |
|
|
inlinestatic |
Decrement a 128bit unsigned integer.
- Author
- Jacob F. W
Definition at line 102 of file uint128.h.
◆ uint128_eq()
static bool uint128_eq |
( |
uint128_t |
a, |
|
|
uint128_t |
b |
|
) |
| |
|
inlinestatic |
Return whether the integers are equal.
Definition at line 250 of file uint128.h.
◆ uint128_gen_mask()
static uint128_t uint128_gen_mask |
( |
uint8_t |
bits | ) |
|
|
inlinestatic |
Create a 128 bit integer value with n bits high.
Definition at line 65 of file uint128.h.
◆ uint128_gt()
static bool uint128_gt |
( |
uint128_t |
a, |
|
|
uint128_t |
b |
|
) |
| |
|
inlinestatic |
Return whether one integer is greater than the other.
Definition at line 258 of file uint128.h.
◆ uint128_increment()
static uint128_t uint128_increment |
( |
uint128_t |
n | ) |
|
|
inlinestatic |
Increment a 128bit unsigned integer.
- Author
- Jacob F. W
Definition at line 88 of file uint128.h.
◆ uint128_lshift()
static uint128_t uint128_lshift |
( |
uint128_t |
num, |
|
|
uint8_t |
bits |
|
) |
| |
|
inlinestatic |
Left shift 128 bit integer.
- Note
- shift must be 127 bits or less.
Definition at line 191 of file uint128.h.
◆ uint128_mul()
static uint128_t uint128_mul |
( |
uint128_t |
n, |
|
|
uint128_t |
m |
|
) |
| |
|
inlinestatic |
Multiply two unsigned 128bit integers.
- Author
- Jacob F. W
Definition at line 177 of file uint128.h.
◆ uint128_mul64()
static uint128_t uint128_mul64 |
( |
uint64_t |
u, |
|
|
uint64_t |
v |
|
) |
| |
|
inlinestatic |
Multiply two unsigned 64bit integers to get an unsigned 128bit integer.
- Author
- Jacob F. W
Definition at line 144 of file uint128.h.
◆ uint128_new()
static uint128_t uint128_new |
( |
uint64_t |
h, |
|
|
uint64_t |
l |
|
) |
| |
|
inlinestatic |
Creates a new uint128_t from a uint64_t.
Definition at line 268 of file uint128.h.
◆ uint128_rshift()
static uint128_t uint128_rshift |
( |
uint128_t |
num, |
|
|
uint8_t |
bits |
|
) |
| |
|
inlinestatic |
Right shift 128 bit integer.
- Note
- shift must be 127 bits or less.
Definition at line 210 of file uint128.h.
◆ uint128_sub()
static uint128_t uint128_sub |
( |
uint128_t |
a, |
|
|
uint128_t |
b |
|
) |
| |
|
inlinestatic |
Subtract one 128bit integer from another.
- Author
- Jacob F. W
Definition at line 128 of file uint128.h.
◆ uint128_to_64()
static uint64_t uint128_to_64 |
( |
uint128_t |
a | ) |
|
|
inlinestatic |
Returns the low bits of a 128bit integer.
Definition at line 279 of file uint128.h.