Class ECDHN

  • All Implemented Interfaces:
    ECDH
    Direct Known Subclasses:
    ECDH256, ECDH384, ECDH521

    public class ECDHN
    extends java.lang.Object
    implements ECDH
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.crypto.KeyAgreement myKeyAgree  
      (package private) java.security.interfaces.ECPublicKey publicKey  
      (package private) byte[] Q_array  
      private static java.math.BigInteger three  
      private static java.math.BigInteger two  
    • Constructor Summary

      Constructors 
      Constructor Description
      ECDHN()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void bzero​(byte[] buf)  
      private byte[] chop0​(byte[] buf)  
      byte[] getQ()  
      byte[] getSecret​(byte[] r, byte[] s)  
      void init​(int size)  
      private byte[] insert0​(byte[] buf)  
      private byte[] toPoint​(byte[] r_array, byte[] s_array)  
      boolean validate​(byte[] r, byte[] s)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • Q_array

        byte[] Q_array
      • publicKey

        java.security.interfaces.ECPublicKey publicKey
      • myKeyAgree

        private javax.crypto.KeyAgreement myKeyAgree
      • two

        private static java.math.BigInteger two
      • three

        private static java.math.BigInteger three
    • Constructor Detail

      • ECDHN

        public ECDHN()
    • Method Detail

      • init

        public void init​(int size)
                  throws java.lang.Exception
        Specified by:
        init in interface ECDH
        Throws:
        java.lang.Exception
      • getQ

        public byte[] getQ()
                    throws java.lang.Exception
        Specified by:
        getQ in interface ECDH
        Throws:
        java.lang.Exception
      • getSecret

        public byte[] getSecret​(byte[] r,
                                byte[] s)
                         throws java.lang.Exception
        Specified by:
        getSecret in interface ECDH
        Throws:
        java.lang.Exception
      • validate

        public boolean validate​(byte[] r,
                                byte[] s)
                         throws java.lang.Exception
        Specified by:
        validate in interface ECDH
        Throws:
        java.lang.Exception
      • toPoint

        private byte[] toPoint​(byte[] r_array,
                               byte[] s_array)
      • insert0

        private byte[] insert0​(byte[] buf)
      • chop0

        private byte[] chop0​(byte[] buf)
      • bzero

        private void bzero​(byte[] buf)