#include <pk.h>
Public Types | |
| typedef Nat const & | cNat |
| const reference to a Nat | |
Public Member Functions | |
Inspectors | |
| int | bit (int k) const |
| Get k-th bit of this object. | |
| int | degree () const |
| Get length of this object in bits. | |
| int | length () const |
| Get length of this object in nwords. | |
Arithmetic and Logical Operations | |
| void | add1 (cnat y) |
| Add number to this one. | |
| void | sub1 (cnat y) |
| Subtract number from this one. | |
| void | subr (cnwordp a) |
| Subtract this object from another. | |
| void | extend (int n) |
| Extend length of this object by specified number of nwords. | |
| void | shiftright (int k=1) |
| Right shift this object by a specified number of bits. | |
| void | shiftleft (int k=1) |
| Left shift this object by a specified number of bits. | |
| void | xorshift (int k, cnat a) |
| Left shift number and XOR into this object. | |
Assignment and Arithmetic Operators | |
| Nat & | operator= (nword x) |
| Assignment operator. | |
| Nat & | operator= (const Nat &x) |
| Assignment operator. | |
| void | operator+= (cnat y) |
| Increment this object by a specified amount. | |
| void | operator-= (cnat y) |
| Decrement this object by a specified amount. | |
Predicates | |
| bool | isOdd () const |
| Predicate to test oddness. | |
| bool | isEven () const |
| Predicate to test evenness. | |
| bool | operator== (nword n) const |
| Predicate to test equality of natural numbers. | |
| bool | operator!= (nword n) const |
| Predicate to test inequality of natural numbers. | |
| bool | operator== (cNat x) const |
| Predicate to test equality of Nat objects. | |
| bool | operator!= (cNat x) const |
| Predicate to test inequality of Nat objects. | |
| bool | operator<= (cNat x) const |
| Predicate to test "less than or equal to" relation between Nat objects. | |
| bool | operator>= (cNat x) const |
| Predicate to test "greater than or equal to" relation between Nat objects. | |
| bool | operator< (cNat x) const |
| Predicate to test "less than" relation between Nat objects. | |
| bool | operator> (cNat x) const |
| Predicate to test "greater than" relation between Nat objects. | |
| void add1 | ( | cnat | y | ) |
Add number to this one.
| y | object to add to this object |
| int bit | ( | int | k | ) | const |
Get k-th bit of this object.
| k | index of bit to return |
| int degree | ( | ) | const |
Get length of this object in bits.
| void extend | ( | int | n | ) |
Extend length of this object by specified number of nwords.
| n | new size of object in nwords. |
| bool isEven | ( | ) | const [inline] |
Predicate to test evenness.
| bool isOdd | ( | ) | const [inline] |
Predicate to test oddness.
| int length | ( | ) | const [inline] |
Get length of this object in nwords.
| bool operator!= | ( | cNat | x | ) | const [inline] |
| bool operator!= | ( | nword | n | ) | const [inline] |
Predicate to test inequality of natural numbers.
| n | nword to compare with this object. |
| void operator+= | ( | cnat | y | ) |
Increment this object by a specified amount.
| y | the number to add to this object |
| void operator-= | ( | cnat | y | ) | [inline] |
Decrement this object by a specified amount.
| y | number to be sutracted from this object |
| bool operator< | ( | cNat | x | ) | const [inline] |
| bool operator<= | ( | cNat | x | ) | const [inline] |
Assignment operator.
| x | Nat to assign to this object |
Warning: this.len *must* be >= x.len
Assignment operator.
| x | nword to assign to this object |
| bool operator== | ( | cNat | x | ) | const [inline] |
| bool operator== | ( | nword | n | ) | const |
Predicate to test equality of natural numbers.
| n | nword to compare with this object. |
| bool operator> | ( | cNat | x | ) | const [inline] |
| bool operator>= | ( | cNat | x | ) | const [inline] |
| void shiftleft | ( | int | k = 1 |
) |
Left shift this object by a specified number of bits.
| k | number of bits to left shift this object. |
| void shiftright | ( | int | k = 1 |
) |
Right shift this object by a specified number of bits.
| k | number of bits to right shift this object. |
| void sub1 | ( | cnat | y | ) |
Subtract number from this one.
| y | object to subtract from this object |
| void subr | ( | cnwordp | a | ) |
Subtract this object from another.
| a | object from which to subtract this object |
| void xorshift | ( | int | k, | |
| cnat | a | |||
| ) |
Left shift number and XOR into this object.
| k | number of bits to leftshift a | |
| a | number to XOR with this Modifies: w (this gets the result of this XOR'd with a left shifted k bits). |
| ISC Cryptographic Development Kit - User's Guide | |
| Questions? E-mail ISC technical support | |
| Copyright© 2002-2006 Information Security Corp. All rights reserved. |