Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/openpgp/src/biginteger/native.interface.js>default

OpenPGP implementation for JavaScript
Go to Latest
class default
import { default } from "https://deno.land/x/openpgp@v5.4.0-proton/src/biginteger/native.interface.js";

Constructors

new
default(n)

Get a BigInteger (input must be big endian for strings and arrays)

Methods

Extended Eucleadian algorithm (http://anh.cs.luc.edu/331/notes/xgcd.pdf) Given a = this and b, compute (x, y) such that ax + by = gdc(a, b)

abs()
add(x)

BigInteger addition

Compute bit length

Compute byte length

dec()

BigInteger decrement

Whether this value is equal to x

gcd(b)

Compute greatest common divisor between this and n

Get value of i-th bit

gt(x)

Whether this value is greater than x

gte(x)

Whether this value is greater than or equal to x

iadd(x)

BigInteger addition in place

BigInteger decrement in place

BigInteger increment in place

Shift this to the left by x, in place

imod(m)

Compute value modulo m, in place

imul(x)

BigInteger multiplication in place

inc()

BigInteger increment

Shift this to the right by x, in place

isub(x)

BigInteger subtraction in place

Shift this to the left by x

lt(x)

Whether this value is less than x

lte(x)

Whether this value is less than or equal to x

mod(m)

Compute value modulo m

modExp(e, n)

Compute modular exponentiation using square and multiply

Compute the inverse of this value modulo n Note: this and and n must be relatively prime

mul(x)

BigInteger multiplication

Shift this to the right by x

sub(x)

BigInteger subtraction

Get this value as an exact Number (max 53 bits) Fails if this value is too large

Get this value as a string

toUint8Array(endian?, length)

Get Uint8Array representation of this number