Class SM9KeyExchange

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] calculateKey​(int klenBits, ECPoint peerR)
      Compute the shared key of klenBits bits from the peer's ephemeral value peerR.
      ECPoint generateEphemeral​(java.security.SecureRandom random)
      Generate this party's ephemeral value R = [r]Q_peer (a G1 point) and retain the ephemeral scalar r.
      byte[] getInitiatorConfirmation()
      S_A = Hash(0x83 || g1 || Hash(g2||g3||IDA||IDB||RA||RB)): the confirmation the initiator sends to (and the responder checks against) the responder.
      byte[] getResponderConfirmation()
      S_B = Hash(0x82 || g1 || Hash(g2||g3||IDA||IDB||RA||RB)): the confirmation the responder sends to (and the initiator checks against) the initiator.
      • Methods inherited from class java.lang.Object

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

      • generateEphemeral

        public ECPoint generateEphemeral​(java.security.SecureRandom random)
        Generate this party's ephemeral value R = [r]Q_peer (a G1 point) and retain the ephemeral scalar r. Q_peer = [H1(peerIdentity||hid, N)]P1 + P_pub-e, using the hid this party's own key was derived under - both parties' keys come from the same KGC, which publishes the hid it chose.
      • getResponderConfirmation

        public byte[] getResponderConfirmation()
        S_B = Hash(0x82 || g1 || Hash(g2||g3||IDA||IDB||RA||RB)): the confirmation the responder sends to (and the initiator checks against) the initiator.

        The returned tag is a secret authenticator; a received value must be compared against it with Arrays.constantTimeAreEqual(byte[], byte[]), not Arrays.equals, to avoid a timing side channel.

      • getInitiatorConfirmation

        public byte[] getInitiatorConfirmation()
        S_A = Hash(0x83 || g1 || Hash(g2||g3||IDA||IDB||RA||RB)): the confirmation the initiator sends to (and the responder checks against) the responder.

        The returned tag is a secret authenticator; a received value must be compared against it with Arrays.constantTimeAreEqual(byte[], byte[]), not Arrays.equals, to avoid a timing side channel.