-
Notifications
You must be signed in to change notification settings - Fork 2
[ Example ] Hash
Jerome SEMETTE edited this page Mar 13, 2026
·
1 revision
This example demonstrates hash computation using the STSAFE-A120 secure element.
The Hash example application illustrates how to compute a SHA-256 hash message using platform crypto library and using STSAFE-A120 device.
The following flowchart outlines the main steps performed by the hash computation example application:
Upon execution, the host terminal displays logs reflecting the ECDH key agreement process, including key generation, public key exchange, and the resulting shared secret.
Example output:
----------------------------------------------------------------------------------------------------------------
- STSAFE-A120 hash commands example -
----------------------------------------------------------------------------------------------------------------
- -
- description : -
- This examples illustrates how to use hash commands of a target STSAFE-A120 device -
- -
----------------------------------------------------------------------------------------------------------------
- Initialize target STSAFE-A120
- Message buffer to hash :
0x17 0x11 0xD5 0xD2 0x26 0xAA 0x09 0xB9 0x54 0x5C 0xA9 0x01 0x94 0x1C 0x68 0xB3
0xFC 0xD3 0xC4 0x69 0x41 0x6B 0xFB 0x07 0x5D 0x3B 0x58 0x16 0x60 0xDE 0xE8 0xBD
0x93 0xE2 0xB2 0xD3 0x46 0x52 0x6D 0x95 0xFA 0xF2 0x4C 0x46 0x66 0xE5 0xCA 0xAC
0x1B 0x26 0xF8 0xDC 0x69 0x82 0x44 0x29 0xAA 0xBC 0x60 0x4A 0x81 0xEC 0xAF 0xE0
0xD1 0x87 0xBB 0xD1 0x44 0x41 0x9D 0x3B 0x40 0xB6 0x61 0x34 0x69 0x51 0x75 0x81
0xA3 0x59 0x2F 0xE0 0x8D 0xFD 0xD7 0xBD 0xE0 0x0E 0xD0 0x56 0xA9 0xA8 0x63 0x0A
0xDD 0x65 0x89 0x0E 0x97 0xA0 0xC9 0x43 0xFE 0xED 0x18 0xAB 0x83 0x71 0x2D 0x3B
0x58 0xB9 0x61 0x7E 0x2C 0x5D 0x84 0x0C 0x7B 0xDD 0xAC 0xD3 0x5B 0xA0 0x9A 0x42
- stse_platform_hash_compute :
0x3F 0x63 0xD2 0x02 0xCB 0xB4 0x88 0x7A 0x06 0xAF 0xE6 0x28 0xBC 0x60 0x78 0x83
0x37 0x89 0x13 0x7E 0x5C 0xC5 0xD6 0x02 0x4A 0xA4 0x53 0xCE 0x4C 0x07 0xD4 0x1B
- stse_compute_hash :
0x3F 0x63 0xD2 0x02 0xCB 0xB4 0x88 0x7A 0x06 0xAF 0xE6 0x28 0xBC 0x60 0x78 0x83
0x37 0x89 0x13 0x7E 0x5C 0xC5 0xD6 0x02 0x4A 0xA4 0x53 0xCE 0x4C 0x07 0xD4 0x1B
- HASH SUCCESS
- STSAFE-A120 Secure Element
- STSAFE-A110 Secure Element
- Feature Description
- Standard Use-cases
- Product Perso Profile
- STSAFE-A120 : X-NUCLEO-ESE01A1
- STSAFE-A110 : X-NUCLEO-SAFEA1
- Software Package Architecture
- Getting Started with Software Package
-
Project examples list
- Project template
- Echo loop
- Random number generation
- NIST P-256 key pair generation
- NIST P-512 key pair generation
- BRAINPOOL P-512 Key Pair Generation
- Edwards-25519 Key Pair Generation
- Secure Data Storage Zone Access
- Secure data storage counter access
- Hash
- Device authentication
- Multi-step device authentication
- Host key provisioning
- Host key provisioning (Wrapped)
- Command Access Condition provisioning
- Secret or key wrapping
- ECDH
- Symmetric key provisioning Control Fields
- Symmetric key establishment AES-128 CMAC
- Symmetric key establishment AES-256 CCM
- Symmetric Key Management AES-128 CMAC
- Symmetric Key Management AES-256 CCM
- Wrapped Symmetric Key Provisioning - AES-128 CMAC
- Wrapped Symmetric Key Provisioning - AES-256 CCM*