Class X448

java.lang.Object
org.bouncycastle.math.ec.rfc7748.X448

public abstract class X448 extends Object
A low-level implementation of X448 (RFC 7748).

Algorithm map.

Side-channel scope. Secret-scalar operations are written to be constant-time at the Java level: the Montgomery ladder in scalarMult(byte[], int, byte[], int, byte[], int) performs identical field operations per bit with branchless cswap; scalarMultBase(byte[], int, byte[], int) routes through the Ed448 signed-comb, which walks all precomputed entries with mask-based cmov rather than a secret-indexed array load and applies conditional negation by XOR-with-mask; the final modular inverse uses constant-time Mod.modOddInverse. The all-zero rejection in calculateAgreement(byte[], int, byte[], int, byte[], int) runs an OR-accumulator and only leaks the RFC-mandated public rejection criterion. This is sufficient against a remote network timing attacker but is not a substitute for a constant-time native implementation against a co-located cache-line-resolution adversary — JVM-level timing variance from JIT, GC and cache eviction is not addressable in pure Java.

  • Field Details

  • Constructor Details

    • X448

      public X448()
  • Method Details

    • calculateAgreement

      public static boolean calculateAgreement(byte[] k, int kOff, byte[] u, int uOff, byte[] r, int rOff)
    • clampPrivateKey

      public static void clampPrivateKey(byte[] k)
    • generatePrivateKey

      public static void generatePrivateKey(SecureRandom random, byte[] k)
    • generatePublicKey

      public static void generatePublicKey(byte[] k, int kOff, byte[] r, int rOff)
    • precompute

      public static void precompute()
    • scalarMult

      public static void scalarMult(byte[] k, int kOff, byte[] u, int uOff, byte[] r, int rOff)
    • scalarMultBase

      public static void scalarMultBase(byte[] k, int kOff, byte[] r, int rOff)