java.lang.Object
net.i2p.crypto.x25519.X25519DH

public class X25519DHextends Object
DH wrapper around Noise's Curve25519 with I2P types.
  • Field Details

    • TYPE

      private static final EncType TYPE
      The encryption type this engine implements.
  • Constructor Details

    • X25519DH

      private X25519DH()
      Utility class, not intended for instantiation.
  • Method Details

    • dh

      public static SessionKey dh(PrivateKey priv, PublicKey pub)
      Curve25519 Diffie-Hellman: computes the shared secret for a private/public key pair.
      Parameters:
      priv - the local ECIES_X25519 private key, the scalar of the Curve25519 op
      pub - MUST have MSB high bit cleared, i.e. pub.getData()[31] & 0x80 == 0
      Returns:
      ECIES_X25519
      Throws:
      IllegalArgumentException - if not ECIES_X25519 or on low-order input see RFC 7748