5.7.29. se05x Multiple Digest Crypto Objects example

This project demonstrates managing multiple crypto objects from application layer. The example will create 2 digest crypto objects which will be used for SHA256 multistep operations. The example can be extended for AES, AEAD, MAC crypto objects also.

Note

Disable SSSFTR_SE05X_CREATE_DELETE_CRYPTOOBJ in cmake options to run this example. This will ensure crypto objects are not created at SSS layer.

5.7.29.1. Building the Demo

  • Build Plug & Trust middleware stack. (Refer Building / Compiling)

  • Project: se05x_MultipleDigestCryptoObj

5.7.29.2. Running the Example

If you have built a binary, flash the binary on to the board and reset the board.

If you have built an exe to be run from Windows using VCOM, run as:

se05x_MultipleDigestCryptoObj.exe <PORT NAME>

Where <PORT NAME> is the VCOM COM port.

On Raspberry-Pi or iMX board, run as:

./se05x_MultipleDigestCryptoObj

5.7.29.3. Console output

If everything is successful, the output will be similar to:

sss   :WARN :Communication channel is Plain.
sss   :WARN :!!!Not recommended for production use.!!!
App   :INFO :Running Multiple Digest Crypto Example se05x_MultipleDigestCryptoObj.c
App   :INFO :Create digest crypto object with id - 58 !!!
App   :INFO :Create digest crypto object with id - 59 !!!
App   :INFO :Calling Update function for crypto objectId1 !!!
App   :INFO :Calling Update function for crypto objectId2 !!!
App   :INFO :Calling Update function for crypto objectId1 !!!
App   :INFO :Calling Update function for crypto objectId2 !!!
App   :INFO :Calling Update function for crypto objectId1 !!!
App   :INFO :Calling Update function for crypto objectId2 !!!
App   :INFO :Message Digest (input1) successful !!!
App   :INFO :digest (Len=32)
      90 B4 6D D6    FA D0 A8 DB    49 69 45 A6    BE 27 D9 5F
      BB 78 60 48    22 35 69 70    56 B8 9B 1D    07 83 68 5E
App   :INFO :Message Digest (input2) successful !!!
App   :INFO :digest (Len=32)
      D8 ED 22 5A    FC 4B B0 9B    47 EF DB 9E    D4 51 7F 2F
      87 4E 3F 61    00 A3 6D 4F    DD 4D 90 B8    7B 70 72 45
App   :INFO :ex_sss Finished
Press any key to continue . . .