Class Chacha20Poly1305

  • All Implemented Interfaces:
    TlsCipher

    public class Chacha20Poly1305
    extends java.lang.Object
    implements TlsCipher
    Deprecated.
    Migrate to the (D)TLS API in org.bouncycastle.tls (bctls jar).
    draft-ietf-tls-chacha20-poly1305-04
    • Field Detail

      • context

        protected TlsContext context
        Deprecated.
      • encryptIV

        protected byte[] encryptIV
        Deprecated.
      • decryptIV

        protected byte[] decryptIV
        Deprecated.
    • Constructor Detail

      • Chacha20Poly1305

        public Chacha20Poly1305​(TlsContext context)
                         throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
    • Method Detail

      • getPlaintextLimit

        public int getPlaintextLimit​(int ciphertextLimit)
        Deprecated.
        Specified by:
        getPlaintextLimit in interface TlsCipher
      • encodePlaintext

        public byte[] encodePlaintext​(long seqNo,
                                      short type,
                                      byte[] plaintext,
                                      int offset,
                                      int len)
                               throws java.io.IOException
        Deprecated.
        Specified by:
        encodePlaintext in interface TlsCipher
        Throws:
        java.io.IOException
      • decodeCiphertext

        public byte[] decodeCiphertext​(long seqNo,
                                       short type,
                                       byte[] ciphertext,
                                       int offset,
                                       int len)
                                throws java.io.IOException
        Deprecated.
        Specified by:
        decodeCiphertext in interface TlsCipher
        Throws:
        java.io.IOException
      • initRecord

        protected KeyParameter initRecord​(StreamCipher cipher,
                                          boolean forEncryption,
                                          long seqNo,
                                          byte[] iv)
        Deprecated.
      • calculateNonce

        protected byte[] calculateNonce​(long seqNo,
                                        byte[] iv)
        Deprecated.
      • calculateRecordMAC

        protected byte[] calculateRecordMAC​(KeyParameter macKey,
                                            byte[] additionalData,
                                            byte[] buf,
                                            int off,
                                            int len)
        Deprecated.
      • updateRecordMACLength

        protected void updateRecordMACLength​(Mac mac,
                                             int len)
        Deprecated.
      • updateRecordMACText

        protected void updateRecordMACText​(Mac mac,
                                           byte[] buf,
                                           int off,
                                           int len)
        Deprecated.
      • getAdditionalData

        protected byte[] getAdditionalData​(long seqNo,
                                           short type,
                                           int len)
                                    throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException