SHOW Signed

net.rim.device.api.crypto
Class CryptoByteArrayArithmetic

java.lang.Object
  |
  +--net.rim.device.api.crypto.CryptoByteArrayArithmetic

public class CryptoByteArrayArithmetic
extends Object

Modular arithmetic on large unsigned integers. Integers are repesented as byte arrays with the most significant byte at position 0 in the array, or position offset if offset is specified. The arrays can be up to 256 bytes long.

When possible, methods that can work with a modulus that is a power of two are provided. In this case, the modulus will be 2log2modulus, where log2modulus is the integer representing log2 of the modulus that will be used in the calculations.

Each arithmetic method also has a version which allows an offset into each array to be specified, as well as the length in bytes of the integer stored in the array. In this case, the integer operated on will be the integer in the array that begins at byte offset and continues for length bytes.

Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim

Since:
JDE 3.6.0

Method Summary
 Category: Signed Category: Certicom static void add(byte[] a, byte[] b, byte[] modulus, byte[] result)
          Computes the sum of the integers represented by arrays a and b, mod the integer represented by the array modulus, and stores the result in the array result.
 Category: Signed Category: Certicom static void add(byte[] a, byte[] b, int log2modulus, byte[] result)
          Computes the sum of the integers represented by arrays a and b, mod 2log2modulus and stores the result in the array result.
 Category: Signed Category: Certicom static void add(byte[] a, int aOffset, int aLength, byte[] b, int bOffset, int bLength, byte[] modulus, int modulusOffset, int modulusLength, byte[] result, int resultOffset, int resultLength)
          Computes the sum of the integers of length length in the arrays beginning at a[ aOffset ] and b[ bOffset ], mod the integer beginning at modulus[ modulusOffset ], and stores the result in the array result, beginning at resultOffset.
 Category: Signed Category: Certicom static void add(byte[] a, int aOffset, int aLength, byte[] b, int bOffset, int bLength, int log2modulus, byte[] result, int resultOffset, int resultLength)
          Computes the sum of the integers in the arrays beginning at a[ aOffset ] and b[ bOffset ], mod 2log2modulus, and stores the result in the array result, beginning at resultOffset.
 Category: Signed Category: Certicom static int compare(byte[] a, byte[] b)
          Compares the integer represented in array a to the one represented in array b.
 Category: Signed Category: Certicom static int compare(byte[] a, int aOffset, int aLength, byte[] b, int bOffset, int bLength)
          Compares the integer represented in array a to the one represented in array b.
 Category: Signed Category: Certicom static byte[] createArray(int log2n)
          Returns an array containing 2^log2n
 Category: Signed Category: Certicom static void decrement(byte[] a, byte[] modulus, byte[] result)
          Subtracts one from the integer represented by the array a, mod the integer represented by the array modulus, and stores the result in the array result.
 Category: Signed Category: Certicom static void decrement(byte[] a, int log2modulus, byte[] result)
          Subtracts one from the integer represented by array a, mod 2log2modulus and stores the result in the array result.
 Category: Signed Category: Certicom static void decrement(byte[] a, int aOffset, int aLength, byte[] modulus, int modulusOffset, int modulusLength, byte[] result, int resultOffset, int resultLength)
          Subtracts one from the integer of length aLength in the array beginning at a[ aOffset ], mod the integer beginning at modulus[ modulusOffset ], and stores the result in the array result beginning at resultOffset.
 Category: Signed Category: Certicom static void decrement(byte[] a, int aOffset, int aLength, int log2modulus, byte[] result, int resultOffset, int resultLength)
          Subtracts one from the integer in the array beginning at a[ aOffset ], mod 2log2modulus, and stores the result in the array result, beginning at resultOffset.
 Category: Signed Category: Certicom static void divide(byte[] dividend, byte[] divisor, byte[] quotient, byte[] remainder)
          Computes the quotient and remainder of dividend / divisor The quotient is stored in quotient, and the remainder is stored in remainder.
 Category: Signed Category: Certicom static void divide(byte[] dividend, int dividendOffset, int dividendLength, byte[] divisor, int divisorOffset, int divisorLength, byte[] quotient, int quotientOffset, int quotientLength, byte[] remainder, int remainderOffset, int remainderLength)
          Computes the quotient and remainder of the integer in the array dividend, beginning at dividendOffset, divided by the integer in the array divisor, beginning at divisorOffset.
 Category: Signed Category: Certicom static void divideByTwo(byte[] a, byte[] modulus, byte[] result)
          Divide the integer represented by the array a by two modulo the integer represented by the array modulus.
 Category: Signed Category: Certicom static void divideByTwo(byte[] a, int log2modulus, byte[] result)
          Divide the integer represented by the array a by a modulus which is a power of 2.
 Category: Signed Category: Certicom static void divideByTwo(byte[] a, int aOffset, int aLength, byte[] modulus, int modulusOffset, int modulusLength, byte[] result, int resultOffset, int resultLength)
          Divide the integer of length aLength beginning at a[ aOffset ] by two modulo the integer of length modulusLength beginning at modulus[ modulusOffset ].
 Category: Signed Category: Certicom static void divideByTwo(byte[] a, int aOffset, int aLength, int log2modulus, byte[] result, int resultOffset, int resultLength)
          Divide the integer of length length beginning at a[ aOffset ] by a modulus which is a power of 2.
 Category: Signed Category: Certicom static byte[] ensureLength(byte[] array, int length)
          Takes a byte array and adjusts its length by trimming or padding it.
 Category: Signed Category: Certicom static void exponent(byte[] base, byte[] exponent, byte[] modulus, byte[] result)
          Modular exponentiation with the integers found in base, exponent and modulus Takes baseexponent mod modulus and stores it in result result must be at least as large as modulus.
 Category: Signed Category: Certicom static void exponent(byte[] base, int baseOffset, int baseLength, byte[] exponent, int exponentOffset, int exponentLength, byte[] modulus, int modulusOffset, int modulusLength, byte[] result, int resultOffset, int resultLength)
          Modular exponentiation with the integers found in base, exponent and modulus Takes basemodulus mod modulus and stores the result in the resultLength bytes of result, beginning at result[ resultOffset ].
 Category: Signed Category: Certicom static int findFirstNonZeroByte(byte[] a, int offset, int length)
          Returns the first non-zero byte in the array a, starting at a[ offset ] continuing for length bytes.
 Category: Signed Category: Certicom static void gcd(byte[] a, byte[] b, byte[] result)
          Computes the greatest common divisor of the integer represented by the array a and the integer represetned by the array b, and stores the result in the array result must be at least as long as the longest of a and b.
 Category: Signed Category: Certicom static void gcd(byte[] a, int aOffset, int aLength, byte[] b, int bOffset, int bLength, byte[] result, int resultOffset, int resultLength)
          Computes the greatest common divisor of the integer represetned by the array a, beginning at aOffset, and the integer represented by the array b, beginning at bOffset and stores the result in the array result, beginning at result[ resultOffset ].
 Category: Signed Category: Certicom static int getNumBits(byte[] array)
          Returns the minimum number of bits required to encode the number contained in array
 Category: Signed Category: Certicom static void increment(byte[] a, byte[] modulus, byte[] result)
          Adds one to the integer represented by the array a, mod the integer represented by the array modulus, and stores the result in the array result.
 Category: Signed Category: Certicom static void increment(byte[] a, int log2modulus, byte[] result)
          Adds one to the integer represented by array a, mod 2log2modulus and stores the result in the array result.
 Category: Signed Category: Certicom static void increment(byte[] a, int aOffset, int aLength, byte[] modulus, int modulusOffset, int modulusLength, byte[] result, int resultOffset, int resultLength)
          Adds one to the integer of length aLength in the array beginning at a[ aOffset ], mod the integer beginning at modulus[ modulusOffset ], and stores the result in the array result beginning at resultOffset.
 Category: Signed Category: Certicom static void increment(byte[] a, int aOffset, int aLength, int log2modulus, byte[] result, int resultOffset, int resultLength)
          Adds one to the integer in the array beginning at a[ aOffset ], mod 2log2modulus, and stores the result in the array result, beginning at resultOffset.
 Category: Signed Category: Certicom static void invert(byte[] a, byte[] modulus, byte[] result)
          Computes the inverse of the integer represented by the array a, modulo the integer represented by the array modulus and stores the result in result.
 Category: Signed Category: Certicom static void invert(byte[] a, int aOffset, int aLength, byte[] modulus, int modulusOffset, int modulusLength, byte[] result, int resultOffset, int resultLength)
          Computes the inverse of the integer in in the array a beginning at aOffset, modulo the integer in modulus beginning at modulusOffset and stores the result the the array result, beginning at result[ resultOffset ].
 Category: Signed Category: Certicom static boolean isOne(byte[] a)
          Compares array a to 1.
 Category: Signed Category: Certicom static boolean isOne(byte[] a, int offset, int length)
          Compares array a to 1.
 Category: Signed Category: Certicom static boolean isZero(byte[] a)
          Compares array a to 0.
 Category: Signed Category: Certicom static boolean isZero(byte[] a, int offset, int length)
          Compares array a to 0.
 Category: Signed Category: Certicom static void mod(byte[] a, byte[] modulus, byte[] result)
          Computes the modulus of the integer represented by the array a moduloed by the integer represented by the array modulus, and stores the result in result.
 Category: Signed Category: Certicom static void mod(byte[] a, int log2modulus, byte[] result)
          Computes the modulus of the integer represented by the array a, moduloed by the an integer which is a power of 2, and stores the result in result.
 Category: Signed Category: Certicom static void mod(byte[] a, int aOffset, int aLength, byte[] modulus, int modulusOffset, int modulusLength, byte[] result, int resultOffset, int resultLength)
          Computes the modulus of the integer in the array a, beginning at aOffset, moduloed by the integer in the array modulus, beginning at modulusOffset, and stores the result in result, beginning at result[ resultOffset ].
 Category: Signed Category: Certicom static void mod(byte[] a, int aOffset, int aLength, int log2modulus, byte[] result, int resultOffset, int resultLength)
          Computes the modulus of the integer in the array a, beginning at aOffset, moduloed by the an integer which is a power of 2 and stores the result in result beginning at result[ resultOffset ].
 Category: Signed Category: Certicom static void multiply(byte[] a, byte[] b, byte[] modulus, byte[] result)
          Computes the product of the integers represented by the arrays a and b, mod the integer represented by the array modulus, and stores the result in the array result.
 Category: Signed Category: Certicom static void multiply(byte[] a, byte[] b, int log2modulus, byte[] result)
          Computes the product of the integers represented by the arrays a and b, mod 2log2modulus, and stores the result in result.
 Category: Signed Category: Certicom static void multiply(byte[] a, int aOffset, int aLength, byte[] b, int bOffset, int bLength, byte[] modulus, int modulusOffset, int modulusLength, byte[] result, int resultOffset, int resultLength)
          Computes the product of the integers in the arrays beginning at a[ aOffset ] and b[ bOffset ], mod the integer in the array beginning at modulus[ modulusOffset ], and stores the result in result, beginning at resultOffset.
 Category: Signed Category: Certicom static void multiply(byte[] a, int aOffset, int aLength, byte[] b, int bOffset, int bLength, int log2modulus, byte[] result, int resultOffset, int resultLength)
          Computes the product of the integers in the arrays beginning at a[ aOffset ] and b[ bOffset ], mod 2log2modulus, and stores the result in result, beginning at resultOffset.
 Category: Signed Category: Certicom static void multiplyByTwo(byte[] a, byte[] modulus, byte[] result)
          Multiply the integer representned by array a by two modulo the integer represented by array modulus.
 Category: Signed Category: Certicom static void multiplyByTwo(byte[] a, int log2modulus, byte[] result)
          Multiply the integer represetned by array a by a modulus which is a power of 2.
 Category: Signed Category: Certicom static void multiplyByTwo(byte[] a, int aOffset, int aLength, byte[] modulus, int modulusOffset, int modulusLength, byte[] result, int resultOffset, int resultLength)
          Multiply the integer of length aLength beginning at a[ aOffset ] by two modulo the integer of length modulusLength beginning at modulus[ modulusOffset ], and stores the result in result beginning at resultOffset.
 Category: Signed Category: Certicom static void multiplyByTwo(byte[] a, int aOffset, int aLength, int log2modulus, byte[] result, int resultOffset, int resultLength)
          Multiply the integer of length length beginning at a[ aOffset ] by a modulus which is a power of 2.
 Category: Signed Category: Certicom static byte[] pad(byte[] array, int numberOfZeroes)
          Pads byte array with zeros.
 Category: Signed Category: Certicom static void square(byte[] a, byte[] modulus, byte[] result)
          Computes the square of the integer represented by the array a, mod the integer represented by the array modulus, and stores the result in the array result must be at least as long as modulus.
 Category: Signed Category: Certicom static void square(byte[] a, int log2modulus, byte[] result)
          Computes the square of the integer represented by the array a, mod 2log2modulus, and stores the result in result.
 Category: Signed Category: Certicom static void square(byte[] a, int aOffset, int aLength, byte[] modulus, int modulusOffset, int modulusLength, byte[] result, int resultOffset, int resultLength)
          Computes the square of the integer of length aLength in the array beginning at a[ aOffset ], mod the integer in the array beginning at modulus[ modulusOffset ], and stores the result in result, beginning at resultOffset.
 Category: Signed Category: Certicom static void square(byte[] a, int aOffset, int aLength, int log2modulus, byte[] result, int resultOffset, int resultLength)
          Computes the square of the integer of length aLength in the array beginning at a[ aOffset ], mod 2log2modulus, and stores the result in result, beginning at resultOffset.
 Category: Signed Category: Certicom static void subtract(byte[] a, byte[] b, byte[] modulus, byte[] result)
          Computes the difference of the integers represented by arrays a and b, mod the integer represented by the array modulus, and stores the result in the array result.
 Category: Signed Category: Certicom static void subtract(byte[] a, byte[] b, int log2modulus, byte[] result)
          Computes the difference of the integers represented by arrays a and b, mod 2log2modulus and stores the result in the array result.
 Category: Signed Category: Certicom static void subtract(byte[] a, int aOffset, int aLength, byte[] b, int bOffset, int bLength, byte[] modulus, int modulusOffset, int modulusLength, byte[] result, int resultOffset, int resultLength)
          Computes the difference of the integers in the arrays beginning at a[ aOffset ] and b[ bOffset ], mod the integer beginning at modulus[ modulusOffset ], and stores the result in the array result, beginning at resultOffset.
 Category: Signed Category: Certicom static void subtract(byte[] a, int aOffset, int aLength, byte[] b, int bOffset, int bLength, int log2modulus, byte[] result, int resultOffset, int resultLength)
          Computes the difference of the integers in the arrays beginning at a[ aOffset ] and b[ bOffset ], mod 2log2modulus, and stores the result in the array result, beginning at resultOffset.
 Category: Signed Category: Certicom static byte[] trim(byte[] array)
          Removes the leading zeros from given byte[] and returns a new byte[] without them.
 Category: Signed Category: Certicom static long valueOf(byte[] array)
          Converts array into a long integer (Note: the returned value should be considered as an unsigned value).
 Category: Signed Category: Certicom static byte[] valueOf(long i)
          Converts i into a byte array.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isZero

public static boolean isZero(byte[] a,
                             int offset,
                             int length)
Compares array a to 0.

Parameters:
a - The array containing the integer to be compared to zero.
offset - The Offset into the array a, where the integer begins.
length - The number of bytes in the integer being compared.
Returns:
Returns true if and only if integer in a equals zero.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


isZero

public static boolean isZero(byte[] a)
Compares array a to 0.

Parameters:
a - The array to be compared to zero.
Returns:
Returns true if and only if integer in a equals zero.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


isOne

public static boolean isOne(byte[] a,
                            int offset,
                            int length)
Compares array a to 1.

Parameters:
a - The array containing the integer to be compared to one.
offset - The offset into the array a, where the integer begins.
length - The number of bytes in the integer being compared.
Returns:
Returns true if and only if the integer in a equals one.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


isOne

public static boolean isOne(byte[] a)
Compares array a to 1.

Parameters:
a - The array to be compared to one.
Returns:
Returns true if and only if integer in a equals one.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


findFirstNonZeroByte

public static int findFirstNonZeroByte(byte[] a,
                                       int offset,
                                       int length)
Returns the first non-zero byte in the array a, starting at a[ offset ] continuing for length bytes.

If the integer represented in the array is zero, the position of the last byte is returned. If there is no data to read the result returned will be -1.

Parameters:
a - The byte array.
offset - The first byte of the integer in a.
length - The length in bytes of the integer in a.
Returns:
The position in a of the first non-zero byte in the integer. If the integer represented in the array is zero, it returns the position of the last byte in the integer.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


compare

public static int compare(byte[] a,
                          int aOffset,
                          int aLength,
                          byte[] b,
                          int bOffset,
                          int bLength)
Compares the integer represented in array a to the one represented in array b.

Parameters:
a - The first integer.
aOffset - The offset into a, where the integer begins.
aLength - The length in bytes of the integer in a.
b - The second integer.
bOffset - The offset into b, where the integer begins.
bLength - The length in bytes of the integer in b.
Returns:
An integer less than, equal to, or greater than 0 if the integer in a is numerically less than, equal to, or greater than the integer in b.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


compare

public static int compare(byte[] a,
                          byte[] b)
Compares the integer represented in array a to the one represented in array b.
Parameters:
a - The first integer.
b - The second integer.
Returns:
An integer less than, equal to, or greater than 0 if the integer in a is numerically less than, equal to, or greater than the integer in b.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


multiplyByTwo

public static void multiplyByTwo(byte[] a,
                                 int aOffset,
                                 int aLength,
                                 byte[] modulus,
                                 int modulusOffset,
                                 int modulusLength,
                                 byte[] result,
                                 int resultOffset,
                                 int resultLength)
                          throws ArithmeticException
Multiply the integer of length aLength beginning at a[ aOffset ] by two modulo the integer of length modulusLength beginning at modulus[ modulusOffset ], and stores the result in result beginning at resultOffset.

Parameters:
a - The integer to multiply by two.
aOffset - The offset into a, where the integer begins.
aLength - The length of the integer in a.
modulus - The modulus.
modulusOffset - The offset into modulus, where the integer begins.
modulusLength - The length of the integer in modulus.
result - The array where the result will be stored.
resultOffset - The offset into result, where the result begins.
resultLength - The length of the integer in result. Must be >= modulusLength.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


multiplyByTwo

public static void multiplyByTwo(byte[] a,
                                 byte[] modulus,
                                 byte[] result)
                          throws ArithmeticException
Multiply the integer representned by array a by two modulo the integer represented by array modulus.

The result must be at least as long as modulus.

Parameters:
a - The integer to multiply by two.
modulus - The modulus.
result - The array where the result is stored.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


multiplyByTwo

public static void multiplyByTwo(byte[] a,
                                 int aOffset,
                                 int aLength,
                                 int log2modulus,
                                 byte[] result,
                                 int resultOffset,
                                 int resultLength)
Multiply the integer of length length beginning at a[ aOffset ] by a modulus which is a power of 2.

Parameters:
a - The integer to multiply by two.
aOffset - The offset into a, where the integer begins.
aLength - The length of the integer in a.
log2modulus - The log2 of the modulus. 0 <= log2modulus <= 8*resultLength.
result - The array where the result will be stored.
resultOffset - The offset into result, where the result begins.
resultLength - The length of the integer in result. resultLength*8 must be at least log2modulus
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


multiplyByTwo

public static void multiplyByTwo(byte[] a,
                                 int log2modulus,
                                 byte[] result)
Multiply the integer represetned by array a by a modulus which is a power of 2. result must be at least as long as modulus

Parameters:
a - The integer to multiply by two.
log2modulus - The log2 of the modulus. 0 <= log2modulus <= 8*the length of result.
result - The array where the result is stored.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


divideByTwo

public static void divideByTwo(byte[] a,
                               int aOffset,
                               int aLength,
                               byte[] modulus,
                               int modulusOffset,
                               int modulusLength,
                               byte[] result,
                               int resultOffset,
                               int resultLength)
                        throws ArithmeticException
Divide the integer of length aLength beginning at a[ aOffset ] by two modulo the integer of length modulusLength beginning at modulus[ modulusOffset ].

NOTE: The result of the operation does not exist if a is odd and modulus is even.

Parameters:
a - The integer to divide by two.
aOffset - The offset into a, where the integer begins.
aLength - The length of the integer in a.
modulus - The modulus.
modulusOffset - The offset into modulus, where the integer begins.
modulusLength - The length of the integer in modulus.
result - The byte array that will store the result.
resultOffset - The offset of the result data within the array.
resultLength - The length of the result data in the array.
Throws:
ArithmeticException - Thrown when the modulus is zero or a is odd and modulus is even.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


divideByTwo

public static void divideByTwo(byte[] a,
                               byte[] modulus,
                               byte[] result)
                        throws ArithmeticException
Divide the integer represented by the array a by two modulo the integer represented by the array modulus.

NOTE: The result of the operation does not exist if a is odd and modulus is even.

Parameters:
a - The integer to multiply by two.
modulus - The modulus.
result - A byte array containing the result.
Throws:
ArithmeticException - Thrown if the modulus is zero or a is odd and modulus is even.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


divideByTwo

public static void divideByTwo(byte[] a,
                               int aOffset,
                               int aLength,
                               int log2modulus,
                               byte[] result,
                               int resultOffset,
                               int resultLength)
Divide the integer of length length beginning at a[ aOffset ] by a modulus which is a power of 2.

NOTE: The result of the operation does not exist if a is odd, since the modulus is even.

Parameters:
a - The integer to divide by two.
aOffset - The offset into a, where the integer begins.
aLength - The length of the integer in a.
log2modulus - The log2 of the modulus. 0 <= log2modulus <= 8*aLength.
result - The byte array that will store the result.
resultOffset - The offset of the result data within the array.
resultLength - The length of the result data in the array.
Throws:
ArithmeticException - Thrown if a is odd.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


divideByTwo

public static void divideByTwo(byte[] a,
                               int log2modulus,
                               byte[] result)
Divide the integer represented by the array a by a modulus which is a power of 2.

NOTE: The result of the operation does not exist if a is odd, since the modulus is even.

Parameters:
a - The integer to divide by two.
log2modulus - The log2 of the modulus 0 <= log2modulus <= 8*the length of a.
result - A byte array containing the result.
Throws:
ArithmeticException - Thrown if a is odd.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


add

public static void add(byte[] a,
                       int aOffset,
                       int aLength,
                       byte[] b,
                       int bOffset,
                       int bLength,
                       byte[] modulus,
                       int modulusOffset,
                       int modulusLength,
                       byte[] result,
                       int resultOffset,
                       int resultLength)
                throws ArithmeticException
Computes the sum of the integers of length length in the arrays beginning at a[ aOffset ] and b[ bOffset ], mod the integer beginning at modulus[ modulusOffset ], and stores the result in the array result, beginning at resultOffset.

Parameters:
a - The array containing the first integer in the addition.
aOffset - The offset into the first array, where the first byte of the first integer is located.
aLength - The length of the integer in a.
b - The array containing the second integer in the addition.
bOffset - The offset into the second array, where the first byte of the second integer is located.
bLength - The length of the integer in b.
modulus - The array containing the modulus of the operation.
modulusOffset - The offset into the modluls array, where the first byte of the modulus integer is located.
modulusLength - The length of the integer in modulus.
result - The array where the result of the modular addition will be stored.
resultOffset - The offset into the result array, where the resulting integer will be stored.
resultLength - The length of the integer in result. Must be >= modulusLength.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


add

public static void add(byte[] a,
                       byte[] b,
                       byte[] modulus,
                       byte[] result)
                throws ArithmeticException
Computes the sum of the integers represented by arrays a and b, mod the integer represented by the array modulus, and stores the result in the array result. result must be at least as long as modulus.

Parameters:
a - The array containing the first integer in the addition.
b - The array containing the second integer in the addition.
modulus - The array containing the modulus of the operation.
result - The array where the result of the modular addition will be stored.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


add

public static void add(byte[] a,
                       int aOffset,
                       int aLength,
                       byte[] b,
                       int bOffset,
                       int bLength,
                       int log2modulus,
                       byte[] result,
                       int resultOffset,
                       int resultLength)
Computes the sum of the integers in the arrays beginning at a[ aOffset ] and b[ bOffset ], mod 2log2modulus, and stores the result in the array result, beginning at resultOffset.

Parameters:
a - The array containing the first integer in the addition.
aOffset - The offset into the first array, where the first byte of the first integer is located.
aLength - The length of the integer in a.
b - The array containing the second integer in the addition.
bOffset - The offset into the second array, where the first byte of the second integer is located.
bLength - The length of the integer in b.
log2modulus - The log2 of the modulus. 0 <= log2modulus <= 8*resultLength.
result - The array where the result of the modular addition will be stored.
resultOffset - The offset into the result array, where the resulting integer will be stored.
resultLength - The length of the integer in result. The value resultLength*8 must be at least log2modulus.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


add

public static void add(byte[] a,
                       byte[] b,
                       int log2modulus,
                       byte[] result)
Computes the sum of the integers represented by arrays a and b, mod 2log2modulus and stores the result in the array result.

Parameters:
a - The array containing the first integer in the addition.
b - The array containing the second integer in the addition.
log2modulus - The log2 of the modulus. 0 <= log2modulus <= 8* the length of result.
result - The array where the result of the modular addition will be stored.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


subtract

public static void subtract(byte[] a,
                            int aOffset,
                            int aLength,
                            byte[] b,
                            int bOffset,
                            int bLength,
                            byte[] modulus,
                            int modulusOffset,
                            int modulusLength,
                            byte[] result,
                            int resultOffset,
                            int resultLength)
                     throws ArithmeticException
Computes the difference of the integers in the arrays beginning at a[ aOffset ] and b[ bOffset ], mod the integer beginning at modulus[ modulusOffset ], and stores the result in the array result, beginning at resultOffset.

Parameters:
a - The array containing the first integer in the subtraction.
aOffset - The offset into the first array, where the first byte of the first integer is located.
aLength - The length of the integer in a.
b - The array containing the second integer in the subtraction.
bOffset - The offset into the second array, where the first byte of the second integer is located.
bLength - The length of the integer in b.
modulus - The array containing the modulus of the operation.
modulusOffset - The offset into the modluls array, where the first byte of the modulus integer is located.
modulusLength - The length of the integer in modulus.
result - The array where the result of the modular subtraction will be stored.
resultOffset - The offset into the result array, where the resulting integer will be stored.
resultLength - The length of the integer in result. Must be >= modulusLength.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


subtract

public static void subtract(byte[] a,
                            byte[] b,
                            byte[] modulus,
                            byte[] result)
                     throws ArithmeticException
Computes the difference of the integers represented by arrays a and b, mod the integer represented by the array modulus, and stores the result in the array result.

The result must be at least as long as modulus.

Parameters:
a - The array containing the first integer in the operation.
b - The array containing the second integer in the operation.
modulus - The array containing the modulus of the operation.
result - The array where the result of the modular operation will be stored.
Throws:
ArithmeticException - Thrown if the modulus is zero.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


subtract

public static void subtract(byte[] a,
                            int aOffset,
                            int aLength,
                            byte[] b,
                            int bOffset,
                            int bLength,
                            int log2modulus,
                            byte[] result,
                            int resultOffset,
                            int resultLength)
Computes the difference of the integers in the arrays beginning at a[ aOffset ] and b[ bOffset ], mod 2log2modulus, and stores the result in the array result, beginning at resultOffset.

Parameters:
a - The array containing the first integer in the operation.
aOffset - The offset into the first array, where the first byte of the first integer is located.
aLength - The length of the integer in a.
b - The array containing the second integer in the operation.
bOffset - The offset into the second array, where the first byte of the second integer is located
bLength - the length of the integer in b.
log2modulus - The log2 of the modulus. 0 <= log2modulus <= 8*resultLength.
result - The array where the result of the modular operation will be stored.
resultOffset - The offset into the result array, where the resulting integer will be stored.
resultLength - The length of the integer in result. resultLength*8 must be at least log2modulus
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


subtract

public static void subtract(byte[] a,
                            byte[] b,
                            int log2modulus,
                            byte[] result)
Computes the difference of the integers represented by arrays a and b, mod 2log2modulus and stores the result in the array result.

Parameters:
a - The array containing the first integer in the operation.
b - The array containing the second integer in the operation.
log2modulus - The log2 of the modulus. 0 <= log2modulus <= 8* the length of result.
result - The array where the result of the modular operation will be stored.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim


multiply

public static void multiply(byte[] a,
                            int aOffset,
                            int aLength,
                            byte[] b,
                            int bOffset,
                            int bLength,
                            byte[] modulus,
                            int modulusOffset,
                            int modulusLength,
                            byte[] result,
                            int resultOffset,
                            int resultLength)
                     throws ArithmeticException
Computes the product of the integers in the arrays beginning at a[ aOffset ] and b[ bOffset ], mod the integer in the array beginning at modulus[ modulusOffset ], and stores the result in result, beginning at resultOffset.

Parameters:
a - The array containing the first integer in the operation.
aOffset - The offset into the first array, where the first byte of the first integer is located.
aLength - The l