MODULE CryptoTestBigNumbers;
IMPORT
BN := CryptoBigNumbers, Out := KernelLog;
PROCEDURE Test1*;
VAR
b1, b2, b3, result: BN.BigNumber;
BEGIN
BN.AssignHex( b1, "0a66791dc6988168de7ab77419bb7fb0", 32 );
BN.AssignHex( b2, "c001c62710270075142942e19a8d8c51", 32 );
BN.AssignHex( b3, "d053b3e3782a1de5dc5af4ebe9946817", 32 );
Out.String("b1: "); BN.Print( b1 );
Out.String("b2: "); BN.Print( b2 );
Out.String("b3: "); BN.Print( b3 ); Out.Ln;
result := BN.Add( b1, b2 );
Out.String("b1 + b2: "); BN.Print( result ); Out.Ln;
result := BN.Sub( b1, b2 );
Out.String("b1 - b2: "); BN.Print( result ); Out.Ln;
result := BN.Mul( b1, b2 );
Out.String("b1 * b2: "); BN.Print( result ); Out.Ln;
result := BN.ModExp( b1, b2, b3 );
Out.String("b1^ b2 mod b3: "); BN.Print( result ); Out.Ln;
END Test1;
END CryptoTestBigNumbers.
SystemTools.Free CryptoTestBigNumbers CryptoBigNumbers~
CryptoTestBigNumbers.Test1~