Class BcTlsAESRecordNumberMask

java.lang.Object
org.bouncycastle.tls.crypto.impl.bc.BcTlsAESRecordNumberMask
All Implemented Interfaces:
TlsRecordNumberMask

public class BcTlsAESRecordNumberMask extends Object implements TlsRecordNumberMask
RFC 9147 4.2.3: Mask = AES-ECB(sn_key, Ciphertext[0..15]).
  • Constructor Summary

    Constructors
    Constructor
    Description
    BcTlsAESRecordNumberMask(org.bouncycastle.crypto.BlockCipher cipher)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    generateMask(byte[] ciphertext, int ciphertextOff, byte[] mask, int maskOff)
    Generate the 16-byte mask for a record whose ciphertext starts at 'ciphertextOff'.
    void
    setKey(byte[] key, int keyOff, int keyLen)
    Set the sequence number key ("sn" traffic key) for this direction.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BcTlsAESRecordNumberMask

      public BcTlsAESRecordNumberMask(org.bouncycastle.crypto.BlockCipher cipher)
  • Method Details

    • setKey

      public void setKey(byte[] key, int keyOff, int keyLen) throws IOException
      Description copied from interface: TlsRecordNumberMask
      Set the sequence number key ("sn" traffic key) for this direction.
      Specified by:
      setKey in interface TlsRecordNumberMask
      Throws:
      IOException
    • generateMask

      public void generateMask(byte[] ciphertext, int ciphertextOff, byte[] mask, int maskOff) throws IOException
      Description copied from interface: TlsRecordNumberMask
      Generate the 16-byte mask for a record whose ciphertext starts at 'ciphertextOff'. At least 16 bytes of ciphertext must be available. The mask is written to mask[maskOff..maskOff + 16).
      Specified by:
      generateMask in interface TlsRecordNumberMask
      Throws:
      IOException