Block-based Registers - 1.0 English

Versal Adaptive SoC Integrated 400G High Speed Channelized Cryptography Engine Subsystem Product Guide (PG372)

Document ID
PG372
Release Date
2024-01-30
Version
1.0 English

Block-based registers are organized in to a series of 16-byte blocks, which align with the HSC Subsystem cipher data-block and AXIS segment size. Each 16-byte block consists of 4*4-byte registers, exactly like the Word-based Registers. A series of blocks is grouped together to create a RAM-like structure in registers. Examples include:

  • CAVP_TX_ENC_REQ_TXT_REG
    • CAVP_TX_ENC_REQ_TXT_REG_0
      • CAVP_TX_ENC_REQ_TXT_REG_0_LSB
      • CAVP_TX_ENC_REQ_TXT_REG_0_MID1
      • CAVP_TX_ENC_REQ_TXT_REG_0_MID2
      • CAVP_TX_ENC_REQ_TXT_REG_0_MSB3
    • ...
    • CAVP_TX_ENC_REQ_TXT_REG_9
      • CAVP_TX_ENC_REQ_TXT_REG_9_LSB
      • CAVP_TX_ENC_REQ_TXT_REG_9_MID1
      • CAVP_TX_ENC_REQ_TXT_REG_9_MID2
      • CAVP_TX_ENC_REQ_TXT_REG_9_MSB3
  • CAVP_TX_ENC_RESP_TXT_REG
    • CAVP_TX_ENC_RESP_TXT_REG_0
      • CAVP_TX_ENC_RESP_TXT_REG_0_LSB
      • CAVP_TX_ENC_RESP_TXT_REG_0_MID1
      • CAVP_TX_ENC_RESP_TXT_REG_0_MID2
      • CAVP_TX_ENC_RESP_TXT_REG_0_MSB3
    • ...
    • CAVP_TX_ENC_RESP_TXT_REG_9
      • CAVP_TX_ENC_RESP_TXT_REG_9_LSB
      • CAVP_TX_ENC_RESP_TXT_REG_9_MID1
      • CAVP_TX_ENC_RESP_TXT_REG_9_MID2
      • CAVP_TX_ENC_RESP_TXT_REG_9_MSB3
  • CAVP_RX_DEC_REQ_TXT_REG
    • CAVP_RX_DEC_REQ_TXT_REG_0
      • CAVP_RX_DEC_REQ_TXT_REG_0_LSB
      • CAVP_RX_DEC_REQ_TXT_REG_0_MID1
      • CAVP_RX_DEC_REQ_TXT_REG_0_MID2
      • CAVP_RX_DEC_REQ_TXT_REG_0_MSB3
    • ...
    • CAVP_ RX_DEC_REQ_TXT_REG_9
      • CAVP_RX_DEC_REQ_TXT_REG_9_LSB
      • CAVP_RX_DEC_REQ_TXT_REG_9_MID1
      • CAVP_RX_DEC_REQ_TXT_REG_9_MID2
      • CAVP_RX_DEC_REQ_TXT_REG_9_MSB3
  • CAVP_ RX_DEC _RESP_TXT_REG
    • CAVP_RX_DEC_RESP_TXT_REG_0
      • CAVP_RX_DEC_RESP_TXT_REG_0_LSB
      • CAVP_RX_DEC_RESP_TXT_REG_0_MID1
      • CAVP_RX_DEC_RESP_TXT_REG_0_MID2
      • CAVP_RX_DEC_RESP_TXT_REG_0_MSB3
    • ...
    • CAVP_RX_DEC_RESP_TXT_REG_9
      • CAVP_RX_DEC_RESP_TXT_REG_9_LSB
      • CAVP_RX_DEC_RESP_TXT_REG_9_MID1
      • CAVP_RX_DEC_RESP_TXT_REG_9_MID2
      • CAVP_RX_DEC_RESP_TXT_REG_9_MSB3

The HSC Subsystem expects the most-significant bytes to be provided first in an AXI4-Stream transaction, and similarly provides the most-significant bytes first on egress. Moreover, the HSC Subsystem expects the AAD portion of the data to be provided before the plain/cipher text portion of the data. The HSC Subsystem provides data on egress in the same way.

As a result, the algorithm for writing to the block-based text registers is as follows:
  1. Concatenate the AAD (if any) and PT/CT (if any) values from the vector: {AAD,PT/CT}.
  2. Pad with 0’s as needed on the right to create an even number of 16-byte blocks.
  3. Break {AAD,PT/CT,0-PAD} in to 16-byte blocks.
  4. Write the leftmost block to CAVP_TX_ENC_REQ_TXT_REG_0 (CAVP_RX_DEC_REQ_TXT_REG_0) by following the procedure in Word-based Registers.
  5. Write the next leftmost block to CAVP_TX_ENC_REQ_TXT_REG_1 (CAVP_RX_DEC_REQ_TXT_REG_1) by following the procedure in Word-based Registers.
  6. Continue until all blocks have been written.

The HSC Subsystem request logic byte-swaps the text from register 0 and provides it first in the AXI4-Stream transaction. Register 1 is byte-swapped and provided second, and so on. This sequence provides the most-significant byte first to the HSC Subsystem. Padding bytes at the end are excluded by setting the enc/dec_igr_axis_tuser_mty<M> (M = 0, 1, …, 7) signals to mark the empty (pad) bytes at EOP.

The HSC Subsystem response logic byte-swaps the first segment of data from the AXI4-Stream transaction and places it in register 0. The second segment of data is byte-swapped and placed in register 1, and so on. This sequence puts the data in the expected format for the CAVP vectors.

As a result, the algorithm for reading block-based text registers is:
  1. Read the CAVP_*_RESP_TXT_REG_0 register by following the procedure in Word-based Registers.
  2. Read the CAVP_*_RESP_TXT_REG_1 register by following the procedure in Word-based Registers.
  3. Concatenate the read values as {REG_0, REG_1}.
  4. Continue until all blocks have been read to create {AAD,PT/CT,0-PAD} (i.e., the same format as writes above).
  5. Extract the appropriate number bytes for AAD, PT/CT, and 0-PAD from the vector.

The following figure shows an example of writing the text registers for Encryption. Reading is the same, but in reverse.

Figure 1. Block-based Write Example