The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
uint128.h File Reference

Common functions for manipulating unsigned 128bit integers on platforms without compiler support. More...

Go to the source code of this file.

Functions

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...
 

Detailed Description

Common functions for manipulating unsigned 128bit integers on platforms without compiler support.

Id
6acf0f34a2c358e843c2e98f610676cc24d36337
Author
Jacob F. W
Arran Cudbard-Bell

Definition in file uint128.h.

Function Documentation

◆ 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.

+ Here is the caller graph for this function:

◆ 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.

+ Here is the caller graph for this function:

◆ 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.

+ Here is the caller graph for this function:

◆ 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.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

+ Here is the caller graph for this function:

◆ 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.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

+ Here is the call graph for this function:

◆ 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.

+ Here is the caller graph for this function:

◆ 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.

+ Here is the caller graph for this function:

◆ 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.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

+ Here is the caller graph for this function:

◆ 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.

+ Here is the caller graph for this function: