Incorrect handling of the donedataLen in the SA2UL_contextProcess

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium
    • SITSW-8683
    • 11.00.00
    • 11.02.00
    • Hide
      am243x-evm
      am243x-lp
      am64xx-evm
      am64xx-sk
      Show
      am243x-evm am243x-lp am64xx-evm am64xx-sk

      The SA2UL_SHA example fails for the input length 8388606 as shown

      [CRYPTO] SHA example started ...
      [crypto_sha:109] gCryptoShaTestInputBuf: 0x90000000
      [crypto_sha:110] gCryptoShaTestOutputBuf: 0x90800000
      [crypto_sha:111] ctxParams.inputLen: 8388606
      [crypto_sha:112] gSa2ulCtxObj.totalLengthInBytes: 8388606
      [SA2UL_pushBuffer:1837] Packet length: 4194303
      [SA2UL_pushBuffer:1879] Fragmebt bit: 1
      [SA2UL_pushBuffer:1837] Packet length: 4194303
      [SA2UL_pushBuffer:1873] Fragmebt bit: 0
      [crypto_sha:128] Computed SHA512 hash:
               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      [CRYPTO] SHA-512 example failed!! 

      This input length divides the buffer into two packets of maximum length and so is processed entirely by the following for loop

      https://github.com/TexasInstruments/tifs-mcu-common/blob/8d201ae32d22d8f4db9d86f1c51112b19486c568/drivers/crypto/sa2ul/sa2ul.c#L1310

      In this for loop, the driver is not reinitializating the `donedataLen` to its default value due to which the driver never pops the buffer leading to the incorrect final hash calculation.

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Connection: Intermediate to External PROD System
                EXTSYNC-6207 - Incorrect handling of the donedataL...
                SYNCHRONIZED
                • Last Sync Date: