java.lang.Object
net.i2p.router.crypto.ratchet.RatchetEntry

class RatchetEntryextends Object
Container for outbound ratchet encryption data including tag, key, nonce, and optional next session keys for message preparation The object returned from SKM.consumeNextAvailableTag() to the engine encrypt.
  • Field Details

    • tag

      public final RatchetSessionTag tag
      The session tag.
    • key

      public final SessionKeyAndNonce key
      The session key.
    • keyID

      public final int keyID
      The key identifier.
    • pn

      public final int pn
      The previous chain length.
    • nextForwardKey

      public final NextSessionKey nextForwardKey
      The next {forward} chain key.
    • nextReverseKey

      public final NextSessionKey nextReverseKey
      The next {reverse} chain key.
    • acksToSend

      public final List<Integer> acksToSend
      ACKs queued for delivery with this entry, or null.
  • Constructor Details

    • RatchetEntry

      public RatchetEntry(RatchetSessionTag tag, SessionKeyAndNonce key, int keyID, int pn)
      Outbound-calculated key.
      Parameters:
      tag - the session tag identifying the key being used
      key - the session key and nonce to encrypt with
      keyID - the key identifier recorded in the message
      pn - the length of the previous ratchet chain
    • RatchetEntry

      public RatchetEntry(RatchetSessionTag tag, SessionKeyAndNonce key, int keyID, int pn, NextSessionKey nextFwdKey, NextSessionKey nextRevKey, List<Integer> acksToSend)
      Full constructor with optional next keys and pending ACKs.
      Parameters:
      tag - the session tag identifying the key being used
      key - the session key and nonce to encrypt with
      keyID - the key identifier recorded in the message
      pn - the length of the previous ratchet chain
      nextFwdKey - the next forward chain key, or null if none was derived
      nextRevKey - the next reverse chain key, or null if none was derived
      acksToSend - the ACK sequence numbers queued for delivery with this entry, or null when none are pending
  • Method Details

    • toString

      public String toString()
      Debug string with tag and key.
      Overrides:
      toString in class Object
      Returns:
      debug string with tag and key