Package org.bouncycastle.math.ec.rfc8032
Class Ed448
java.lang.Object
org.bouncycastle.math.ec.rfc8032.Ed448
A low-level implementation of the Ed448 and Ed448ph instantiations of the Edwards-Curve Digital Signature
Algorithm specified in RFC 8032.
The implementation uses the "signed mult-comb" algorithm (for scalar multiplication by a fixed point) from Mike Hamburg, "Fast and compact elliptic-curve cryptography". Standard projective coordinates are used for most point arithmetic.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Xof
static void
encodePublicPoint
(Ed448.PublicPoint publicPoint, byte[] pk, int pkOff) static void
generatePrivateKey
(SecureRandom random, byte[] k) static Ed448.PublicPoint
generatePublicKey
(byte[] sk, int skOff) static void
generatePublicKey
(byte[] sk, int skOff, byte[] pk, int pkOff) static void
static void
scalarMultBaseXY
(X448.Friend friend, byte[] k, int kOff, int[] x, int[] y) NOTE: Only for use by X448static void
sign
(byte[] sk, int skOff, byte[] ctx, byte[] m, int mOff, int mLen, byte[] sig, int sigOff) static void
sign
(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte[] m, int mOff, int mLen, byte[] sig, int sigOff) static void
signPrehash
(byte[] sk, int skOff, byte[] ctx, byte[] ph, int phOff, byte[] sig, int sigOff) static void
signPrehash
(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte[] ph, int phOff, byte[] sig, int sigOff) static void
signPrehash
(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, Xof ph, byte[] sig, int sigOff) static void
signPrehash
(byte[] sk, int skOff, byte[] ctx, Xof ph, byte[] sig, int sigOff) static boolean
validatePublicKeyFull
(byte[] pk, int pkOff) static Ed448.PublicPoint
validatePublicKeyFullExport
(byte[] pk, int pkOff) static boolean
validatePublicKeyPartial
(byte[] pk, int pkOff) static Ed448.PublicPoint
validatePublicKeyPartialExport
(byte[] pk, int pkOff) static boolean
verify
(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte[] m, int mOff, int mLen) static boolean
verify
(byte[] sig, int sigOff, Ed448.PublicPoint publicPoint, byte[] ctx, byte[] m, int mOff, int mLen) static boolean
verifyPrehash
(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte[] ph, int phOff) static boolean
verifyPrehash
(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, Xof ph) static boolean
verifyPrehash
(byte[] sig, int sigOff, Ed448.PublicPoint publicPoint, byte[] ctx, byte[] ph, int phOff) static boolean
verifyPrehash
(byte[] sig, int sigOff, Ed448.PublicPoint publicPoint, byte[] ctx, Xof ph)
-
Field Details
-
PREHASH_SIZE
public static final int PREHASH_SIZE- See Also:
-
PUBLIC_KEY_SIZE
public static final int PUBLIC_KEY_SIZE- See Also:
-
SECRET_KEY_SIZE
public static final int SECRET_KEY_SIZE- See Also:
-
SIGNATURE_SIZE
public static final int SIGNATURE_SIZE- See Also:
-
-
Constructor Details
-
Ed448
public Ed448()
-
-
Method Details
-
createPrehash
-
encodePublicPoint
-
generatePrivateKey
-
generatePublicKey
public static void generatePublicKey(byte[] sk, int skOff, byte[] pk, int pkOff) -
generatePublicKey
-
precompute
public static void precompute() -
scalarMultBaseXY
NOTE: Only for use by X448 -
sign
public static void sign(byte[] sk, int skOff, byte[] ctx, byte[] m, int mOff, int mLen, byte[] sig, int sigOff) -
sign
public static void sign(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte[] m, int mOff, int mLen, byte[] sig, int sigOff) -
signPrehash
public static void signPrehash(byte[] sk, int skOff, byte[] ctx, byte[] ph, int phOff, byte[] sig, int sigOff) -
signPrehash
public static void signPrehash(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte[] ph, int phOff, byte[] sig, int sigOff) -
signPrehash
-
signPrehash
public static void signPrehash(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, Xof ph, byte[] sig, int sigOff) -
validatePublicKeyFull
public static boolean validatePublicKeyFull(byte[] pk, int pkOff) -
validatePublicKeyFullExport
-
validatePublicKeyPartial
public static boolean validatePublicKeyPartial(byte[] pk, int pkOff) -
validatePublicKeyPartialExport
-
verify
public static boolean verify(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte[] m, int mOff, int mLen) -
verify
public static boolean verify(byte[] sig, int sigOff, Ed448.PublicPoint publicPoint, byte[] ctx, byte[] m, int mOff, int mLen) -
verifyPrehash
public static boolean verifyPrehash(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte[] ph, int phOff) -
verifyPrehash
public static boolean verifyPrehash(byte[] sig, int sigOff, Ed448.PublicPoint publicPoint, byte[] ctx, byte[] ph, int phOff) -
verifyPrehash
public static boolean verifyPrehash(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, Xof ph) -
verifyPrehash
public static boolean verifyPrehash(byte[] sig, int sigOff, Ed448.PublicPoint publicPoint, byte[] ctx, Xof ph)
-