Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Friends | List of all members
Botan::donna128 Class Reference

`#include <donna128.h>`

## Public Member Functions
| donna128 (uint64_t ll=0, uint64_t hh=0)
| donna128 (const donna128 &)=default
uint64_t | hi () const
uint64_t | lo () const
uint64_t | operator&= (uint64_t mask)
donna128 & | operator+= (const donna128 &x)
donna128 & | operator+= (uint64_t x)
donna128 & | operator= (const donna128 &)=default

## Friends
uint64_t | operator& (const donna128 &x, uint64_t mask)
donna128 | operator<< (const donna128 &x, size_t shift)
donna128 | operator>> (const donna128 &x, size_t shift)

## Detailed Description

Definition at line 15 of file donna128.h.

## Constructor & Destructor Documentation

Botan::donna128::donna128 | ( | uint64_t | ll = `0`,
|  | uint64_t | hh = `0`
| ) |  |
| inline

Definition at line 18 of file donna128.h.

18 { l = ll; h = hh; }

Botan::donna128::donna128 | ( | const donna128 & |  | ) |
| default

## Member Function Documentation

uint64_t Botan::donna128::hi | ( |  | ) | const
| inline

Definition at line 75 of file donna128.h.

Referenced by Botan::operator*(), and Botan::operator|().

75 { return h; }

uint64_t Botan::donna128::lo | ( |  | ) | const
| inline

Definition at line 74 of file donna128.h.

Referenced by Botan::combine_lower(), Botan::operator*(), and Botan::operator|().

74 { return l; }

uint64_t Botan::donna128::operator&= | ( | uint64_t | mask | ) |
| inline

Definition at line 52 of file donna128.h.

53 {
54 h = 0;
55 l &= mask;
56 return l;
57 }

donna128& Botan::donna128::operator+= | ( | const donna128 & | x | ) |
| inline

Definition at line 59 of file donna128.h.

60 {
61 l += x.l;
62 h += (l < x.l);
63 h += x.h;
64 return *this;
65 }

donna128& Botan::donna128::operator+= | ( | uint64_t | x | ) |
| inline

Definition at line 67 of file donna128.h.

68 {
69 l += x;
70 h += (l < x);
71 return *this;
72 }

donna128& Botan::donna128::operator= | ( | const donna128 & |  | ) |
| default

## Friends And Related Function Documentation

uint64_t operator& | ( | const donna128 & | x,
|  | uint64_t | mask
| ) |  |
| friend

Definition at line 47 of file donna128.h.

48 {
49 return x.l & mask;
50 }

donna128 operator<< | ( | const donna128 & | x,
|  | size_t | shift
| ) |  |
| friend

Definition at line 35 of file donna128.h.

36 {
37 donna128 z = x;
38 if(shift > 0)
39 {
40 const uint64_t carry = z.l >> (64 - shift);
41 z.l = (z.l << shift);
42 z.h = (z.h << shift) | carry;
43 }
44 return z;
45 }
Botan::donna128::donna128
donna128(uint64_t ll=0, uint64_t hh=0)
Definition: donna128.h:18

donna128 operator>> | ( | const donna128 & | x,
|  | size_t | shift
| ) |  |
| friend

Definition at line 23 of file donna128.h.

24 {
25 donna128 z = x;
26 if(shift > 0)
27 {
28 const uint64_t carry = z.h << (64 - shift);
29 z.h = (z.h >> shift);
30 z.l = (z.l >> shift) | carry;
31 }
32 return z;
33 }
Botan::donna128::donna128
donna128(uint64_t ll=0, uint64_t hh=0)
Definition: donna128.h:18

The documentation for this class was generated from the following file:

- src/lib/utils/donna128.h