|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectds.ov2.bignat.Convenience
public class Convenience
BigInteger
convenience interface
to selected Bignat
methods.
For a number of general topics see also the package description.
Nested Class Summary | |
---|---|
static class |
Convenience.Timed_result
BigInteger , long tuple for
methods that produce such results. |
Constructor Summary | |
---|---|
private |
Convenience()
Static class, object creation disabled. |
Method Summary | |
---|---|
static BigInteger |
bi_from_bn(Bignat bn)
Convert Bignat into BigInteger . |
static Bignat |
bn_from_bi(int bignat_size,
BigInteger bi)
Convert BigInteger into Bignat . |
static Convenience.Timed_result |
exponent_mod(BigInteger base,
BigInteger exponent,
BigInteger modulus)
Convenience interface to Bignat.exponent_mod . |
static Convenience.Timed_result |
vector_exponent_mod(BigInteger[] bases,
BigInteger[] exponents,
BigInteger modulus)
Convenience interface to Vector.exponent_mod . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private Convenience()
Method Detail |
---|
public static Bignat bn_from_bi(int bignat_size, BigInteger bi) throws IllegalArgumentException
BigInteger
into Bignat
.
Converts BigInteger bi
into a Bignat of size
bignat_size
, which, of course must be large enough.
The BigInteger must be positive or zero,
the result is arbitrary.
bignat_size
- size of the returned Bignatbi
- source BigInteger
IllegalArgumentException
- if bignat_size
is not a non-zero positive short or if bi
does not fit
into bignat_size
bytes.public static BigInteger bi_from_bn(Bignat bn)
Bignat
into BigInteger
.
bn
- Bignat to convert
public static Convenience.Timed_result exponent_mod(BigInteger base, BigInteger exponent, BigInteger modulus) throws IllegalArgumentException
Bignat.exponent_mod
. Computes base^exponent (modulo modulus)
using Bignat.exponent_mod and returns the result as BigInteger
together with the running time of Bignat.exponent_mod.
The sizes for the Bignats are computed internally.
Montgomerization and preparation of the modulus are done with the BigInteger class. Preparation and postprocessing is not contained in the measured time.
base
- exponent
- modulus
-
base^exponent (modulo modulus)
together with
the duration of Bignat.exponent_mod
in nanoseconds.
IllegalArgumentException
- if the modulus is even or
either base or exponent are longer than Short.MAX_VALUE
bytes.public static Convenience.Timed_result vector_exponent_mod(BigInteger[] bases, BigInteger[] exponents, BigInteger modulus) throws IllegalArgumentException
Vector.exponent_mod
. Computes
bases[0]^exponents[0] * ... * bases[n]^exponents[n]
(modulo modulus)
using Vector.exponent_mod and returns the result as BigInteger
together with the running time of Vector.exponent_mod.
The sizes for the Bignats are computed internally. There are no size constraints on the base and exponent arguments.
Montgomerization and preparation of the modulus are done with the BigInteger class. Preparation and postprocessing is not contained in the measured time.
bases
- array of the basesexponents
- array of the exponentsmodulus
-
bases[0]^exponents[0] * ... * bases[n]^exponents[n]
(modulo modulus)
together with the duration in
nonoseconds
IllegalArgumentException
- if the modulus is even,
if bases
and exponents
have different length,
and if
either bases or exponents are longer than Short.MAX_VALUE
bytes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |