public abstract class Ed25519
extends java.lang.Object
The implementation strategy is mostly drawn from Mike Hamburg, "Fast and compact elliptic-curve cryptography", notably the "signed multi-comb" algorithm (for scalar multiplication by a fixed point), the "half Niels coordinates" (for precomputed points), and the "extensible coordinates" (for accumulators). Standard extended coordinates are used during precomputations, needing only a single extra point addition formula.
Modifier and Type | Class and Description |
---|---|
static class |
Ed25519.Algorithm |
static class |
Ed25519.PublicPoint |
Modifier and Type | Field and Description |
---|---|
static int |
PREHASH_SIZE |
static int |
PUBLIC_KEY_SIZE |
static int |
SECRET_KEY_SIZE |
static int |
SIGNATURE_SIZE |
Constructor and Description |
---|
Ed25519() |
Modifier and Type | Method and Description |
---|---|
static Digest |
createPrehash() |
static void |
encodePublicPoint(Ed25519.PublicPoint publicPoint,
byte[] pk,
int pkOff) |
static void |
generatePrivateKey(java.security.SecureRandom random,
byte[] k) |
static Ed25519.PublicPoint |
generatePublicKey(byte[] sk,
int skOff) |
static void |
generatePublicKey(byte[] sk,
int skOff,
byte[] pk,
int pkOff) |
static void |
precompute() |
static void |
scalarMultBaseYZ(X25519.Friend friend,
byte[] k,
int kOff,
int[] y,
int[] z)
NOTE: Only for use by X25519
|
static 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 |
sign(byte[] sk,
int skOff,
byte[] pk,
int pkOff,
byte[] m,
int mOff,
int mLen,
byte[] sig,
int sigOff) |
static void |
sign(byte[] sk,
int skOff,
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[] ctx,
Digest ph,
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,
Digest ph,
byte[] sig,
int sigOff) |
static boolean |
validatePublicKeyFull(byte[] pk,
int pkOff) |
static Ed25519.PublicPoint |
validatePublicKeyFullExport(byte[] pk,
int pkOff) |
static boolean |
validatePublicKeyPartial(byte[] pk,
int pkOff) |
static Ed25519.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,
byte[] pk,
int pkOff,
byte[] m,
int mOff,
int mLen) |
static boolean |
verify(byte[] sig,
int sigOff,
Ed25519.PublicPoint publicPoint,
byte[] ctx,
byte[] m,
int mOff,
int mLen) |
static boolean |
verify(byte[] sig,
int sigOff,
Ed25519.PublicPoint publicPoint,
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,
Digest ph) |
static boolean |
verifyPrehash(byte[] sig,
int sigOff,
Ed25519.PublicPoint publicPoint,
byte[] ctx,
byte[] ph,
int phOff) |
static boolean |
verifyPrehash(byte[] sig,
int sigOff,
Ed25519.PublicPoint publicPoint,
byte[] ctx,
Digest ph) |
public static final int PREHASH_SIZE
public static final int PUBLIC_KEY_SIZE
public static final int SECRET_KEY_SIZE
public static final int SIGNATURE_SIZE
public static Digest createPrehash()
public static void encodePublicPoint(Ed25519.PublicPoint publicPoint, byte[] pk, int pkOff)
public static void generatePrivateKey(java.security.SecureRandom random, byte[] k)
public static void generatePublicKey(byte[] sk, int skOff, byte[] pk, int pkOff)
public static Ed25519.PublicPoint generatePublicKey(byte[] sk, int skOff)
public static void precompute()
public static void scalarMultBaseYZ(X25519.Friend friend, byte[] k, int kOff, int[] y, int[] z)
public static void sign(byte[] sk, int skOff, byte[] m, int mOff, int mLen, byte[] sig, int sigOff)
public static void sign(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] m, int mOff, int mLen, byte[] sig, int sigOff)
public static void sign(byte[] sk, int skOff, byte[] ctx, byte[] m, int mOff, int mLen, byte[] sig, int sigOff)
public static void sign(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte[] m, int mOff, int mLen, byte[] sig, int sigOff)
public static void signPrehash(byte[] sk, int skOff, byte[] ctx, byte[] ph, int phOff, byte[] sig, int sigOff)
public static void signPrehash(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte[] ph, int phOff, byte[] sig, int sigOff)
public static void signPrehash(byte[] sk, int skOff, byte[] ctx, Digest ph, byte[] sig, int sigOff)
public static void signPrehash(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, Digest ph, byte[] sig, int sigOff)
public static boolean validatePublicKeyFull(byte[] pk, int pkOff)
public static Ed25519.PublicPoint validatePublicKeyFullExport(byte[] pk, int pkOff)
public static boolean validatePublicKeyPartial(byte[] pk, int pkOff)
public static Ed25519.PublicPoint validatePublicKeyPartialExport(byte[] pk, int pkOff)
public static boolean verify(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] m, int mOff, int mLen)
public static boolean verify(byte[] sig, int sigOff, Ed25519.PublicPoint publicPoint, byte[] m, int mOff, int mLen)
public static boolean verify(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte[] m, int mOff, int mLen)
public static boolean verify(byte[] sig, int sigOff, Ed25519.PublicPoint publicPoint, byte[] ctx, byte[] m, int mOff, int mLen)
public static boolean verifyPrehash(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte[] ph, int phOff)
public static boolean verifyPrehash(byte[] sig, int sigOff, Ed25519.PublicPoint publicPoint, byte[] ctx, byte[] ph, int phOff)
public static boolean verifyPrehash(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, Digest ph)
public static boolean verifyPrehash(byte[] sig, int sigOff, Ed25519.PublicPoint publicPoint, byte[] ctx, Digest ph)