C# Class Mono.Math.BigInteger.Kernel

Low level functions for the BigInteger
Datei anzeigen Open project: rackerlabs/openstack-guest-agents-windows-xenserver

Public Methods

Method Description
AddSameSign ( BigInteger bi1, BigInteger bi2 ) : BigInteger

Adds two numbers with the same sign.

Compare ( BigInteger bi1, BigInteger bi2 ) : Sign

Compares two BigInteger

Double ( uint u, int l ) : bool
DwordDiv ( BigInteger n, uint d ) : BigInteger
DwordDivMod ( BigInteger n, uint d ) : Mono.Math.BigInteger[]
DwordMod ( BigInteger n, uint d ) : uint
LeftShift ( BigInteger bi, int n ) : BigInteger
MinusEq ( BigInteger big, BigInteger small ) : void
Multiply ( uint x, uint xOffset, uint xLen, uint y, uint yOffset, uint yLen, uint d, uint dOffset ) : void

Multiplies the data in x [xOffset:xOffset+xLen] by y [yOffset:yOffset+yLen] and puts it into d [dOffset:dOffset+xLen+yLen].

This code is unsafe! It is the caller's responsibility to make sure that it is safe to access x [xOffset:xOffset+xLen], y [yOffset:yOffset+yLen], and d [dOffset:dOffset+xLen+yLen].

MultiplyByDword ( BigInteger n, uint f ) : BigInteger
MultiplyMod2p32pmod ( uint x, int xOffset, int xLen, uint y, int yOffest, int yLen, uint d, int dOffset, int mod ) : void

Multiplies the data in x [xOffset:xOffset+xLen] by y [yOffset:yOffset+yLen] and puts the low mod words into d [dOffset:dOffset+mod].

This code is unsafe! It is the caller's responsibility to make sure that it is safe to access x [xOffset:xOffset+xLen], y [yOffset:yOffset+yLen], and d [dOffset:dOffset+mod].

PlusEq ( BigInteger bi1, BigInteger bi2 ) : void
RightShift ( BigInteger bi, int n ) : BigInteger
SingleByteDivideInPlace ( BigInteger n, uint d ) : uint

Performs n / d and n % d in one operation.

SquarePositive ( BigInteger bi, uint &wkSpace ) : void
Subtract ( BigInteger big, BigInteger small ) : BigInteger
gcd ( BigInteger a, BigInteger b ) : BigInteger
modInverse ( BigInteger bi, BigInteger modulus ) : BigInteger
modInverse ( BigInteger bi, uint modulus ) : uint
multiByteDivide ( BigInteger bi1, BigInteger bi2 ) : Mono.Math.BigInteger[]

Method Details

AddSameSign() public static method

Adds two numbers with the same sign.
public static AddSameSign ( BigInteger bi1, BigInteger bi2 ) : BigInteger
bi1 BigInteger A BigInteger
bi2 BigInteger A BigInteger
return BigInteger

Compare() public static method

Compares two BigInteger
public static Compare ( BigInteger bi1, BigInteger bi2 ) : Sign
bi1 BigInteger A BigInteger
bi2 BigInteger A BigInteger
return Sign

Double() public static method

public static Double ( uint u, int l ) : bool
u uint
l int
return bool

DwordDiv() public static method

public static DwordDiv ( BigInteger n, uint d ) : BigInteger
n BigInteger
d uint
return BigInteger

DwordDivMod() public static method

public static DwordDivMod ( BigInteger n, uint d ) : Mono.Math.BigInteger[]
n BigInteger
d uint
return Mono.Math.BigInteger[]

DwordMod() public static method

public static DwordMod ( BigInteger n, uint d ) : uint
n BigInteger
d uint
return uint

LeftShift() public static method

public static LeftShift ( BigInteger bi, int n ) : BigInteger
bi BigInteger
n int
return BigInteger

MinusEq() public static method

public static MinusEq ( BigInteger big, BigInteger small ) : void
big BigInteger
small BigInteger
return void

Multiply() public static method

Multiplies the data in x [xOffset:xOffset+xLen] by y [yOffset:yOffset+yLen] and puts it into d [dOffset:dOffset+xLen+yLen].
This code is unsafe! It is the caller's responsibility to make sure that it is safe to access x [xOffset:xOffset+xLen], y [yOffset:yOffset+yLen], and d [dOffset:dOffset+xLen+yLen].
public static Multiply ( uint x, uint xOffset, uint xLen, uint y, uint yOffset, uint yLen, uint d, uint dOffset ) : void
x uint
xOffset uint
xLen uint
y uint
yOffset uint
yLen uint
d uint
dOffset uint
return void

MultiplyByDword() public static method

public static MultiplyByDword ( BigInteger n, uint f ) : BigInteger
n BigInteger
f uint
return BigInteger

MultiplyMod2p32pmod() public static method

Multiplies the data in x [xOffset:xOffset+xLen] by y [yOffset:yOffset+yLen] and puts the low mod words into d [dOffset:dOffset+mod].
This code is unsafe! It is the caller's responsibility to make sure that it is safe to access x [xOffset:xOffset+xLen], y [yOffset:yOffset+yLen], and d [dOffset:dOffset+mod].
public static MultiplyMod2p32pmod ( uint x, int xOffset, int xLen, uint y, int yOffest, int yLen, uint d, int dOffset, int mod ) : void
x uint
xOffset int
xLen int
y uint
yOffest int
yLen int
d uint
dOffset int
mod int
return void

PlusEq() public static method

public static PlusEq ( BigInteger bi1, BigInteger bi2 ) : void
bi1 BigInteger
bi2 BigInteger
return void

RightShift() public static method

public static RightShift ( BigInteger bi, int n ) : BigInteger
bi BigInteger
n int
return BigInteger

SingleByteDivideInPlace() public static method

Performs n / d and n % d in one operation.
public static SingleByteDivideInPlace ( BigInteger n, uint d ) : uint
n BigInteger A BigInteger, upon exit this will hold n / d
d uint The divisor
return uint

SquarePositive() public static method

public static SquarePositive ( BigInteger bi, uint &wkSpace ) : void
bi BigInteger
wkSpace uint
return void

Subtract() public static method

public static Subtract ( BigInteger big, BigInteger small ) : BigInteger
big BigInteger
small BigInteger
return BigInteger

gcd() public static method

public static gcd ( BigInteger a, BigInteger b ) : BigInteger
a BigInteger
b BigInteger
return BigInteger

modInverse() public static method

public static modInverse ( BigInteger bi, BigInteger modulus ) : BigInteger
bi BigInteger
modulus BigInteger
return BigInteger

modInverse() public static method

public static modInverse ( BigInteger bi, uint modulus ) : uint
bi BigInteger
modulus uint
return uint

multiByteDivide() public static method

public static multiByteDivide ( BigInteger bi1, BigInteger bi2 ) : Mono.Math.BigInteger[]
bi1 BigInteger
bi2 BigInteger
return Mono.Math.BigInteger[]