|
IAIK ECC version 2.18 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.security.ecc.util.Utils
A collection of some useful functions.
Constructor Summary | |
Utils()
|
Method Summary | |
static boolean |
equalsBlock(int[] a,
int[] b)
Checks two int blocks for equality. |
static boolean |
equalsBlock(int[] a,
int aOff,
int[] b,
int bOff,
int len)
Check the specified sub-sequences of the given int arrays for equality. |
static ECPrivateKey |
getECPrivateKey(java.security.Key key)
Converts a key to an IAIK ECPublicKey. |
static ECPublicKey |
getECPublicKey(java.security.Key key)
Converts a key to an IAIK ECPublicKey. |
static PointCompressor |
getPointCompression()
Method to look, if the class CompressorImpl is in the classpath. |
static boolean |
isOnCurve(ECPoint p)
Checks if a point is on the elliptic curve. |
static boolean |
isSpeedUpEnabled()
Method to look, if the class FastPrimeCurve is in the classpath. |
static boolean |
orderCheck(ECPoint p,
java.math.BigInteger order)
Calculates p.multiply(order), where p is a point on the curve and order is the order of this point. |
static void |
setSpeedUpsEnabled(boolean enable)
This method can manually set whether or not the iaik_ecc_addon.jar should be used. |
static java.util.Set |
toSet(java.lang.Object[] o)
A convenience method to convert the given array into a Set. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Utils()
Method Detail |
public static boolean equalsBlock(int[] a, int aOff, int[] b, int bOff, int len)
a
- the first int arrayaOff
- the offset indicating the start position within the first int array; the following
len
ints are compared with the corresponding number of ints of the second int
arrayb
- the second int arraybOff
- the offset indicating the start position within the second int array; the following
len
ints are compared with the corresponding number of ints of the first int
arraylen
- the number of ints to be compared
true
if the two sub-arrays have the same contents, false
if notpublic static boolean equalsBlock(int[] a, int[] b)
a
- the first int array to be compared with the second int arrayb
- the second int array to be compared with the first int array
true
if the two blocks have the same contents, false
if notpublic static java.util.Set toSet(java.lang.Object[] o)
o
- the array of objects to add to the set.
public static boolean isOnCurve(ECPoint p)
public static boolean orderCheck(ECPoint p, java.math.BigInteger order)
p
- the point on the elliptic curveorder
- the order of the point p
public static boolean isSpeedUpEnabled()
FastPrimeCurve
is in the classpath. (It is then assumed that
iaik_ecc_addon.jar is included in the classpath.)
true
, if iaik_ecc_addon.jar is included in the classpath.public static PointCompressor getPointCompression()
CompressorImpl
is in the classpath. (It is then assumed that
iaik_ecc_addon.jar is included in the classpath.)
PointCompressor
implementation, if iaik_ecc_addon.jar is included in
the classpath.public static void setSpeedUpsEnabled(boolean enable)
enable
is set to true
. No classloader will be used to look for the
respective implementations.
enable
- Boolean to set manually, if the jar file containing the speed-ups is present.
Disables the classloader.public static ECPublicKey getECPublicKey(java.security.Key key) throws java.security.InvalidKeyException
key
- the key to be converted
java.security.InvalidKeyException
- if the key cannot be convertedpublic static ECPrivateKey getECPrivateKey(java.security.Key key) throws java.security.InvalidKeyException
key
- the key to be converted
java.security.InvalidKeyException
- if the key cannot be converted
|
IAIK ECC version 2.18 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |