11.12.3.4.58. Function Se05x_API_CipherInit

11.12.3.4.58.1. Function Documentation

smStatus_t Se05x_API_CipherInit(pSe05xSession_t session_ctx, uint32_t objectID, SE05x_CryptoObjectID_t cryptoObjectID, uint8_t *IV, size_t IVLen, const SE05x_Cipher_Oper_t operation)

Se05x_API_CipherInit

Initialize a symmetric encryption or decryption. The Crypto Object keeps the state of the cipher operation until it’s finalized or deleted. Once the CipherFinal function is executed successfully, the Crypto Object state returns to the state immediately after the previous CipherInit function.

Command to Applet

Field

Value

Description

CLA

0x80

INS

INS_CRYPTO

SE05x_INS_t

P1

P1_CIPHER

See SE05x_P1_t

P2

P2_ENCRYPT or P2_DECRYPT

See SE05x_P2_t

Lc

#(Payload)

Payload

TLV[TAG_1]

4-byte identifier of the key object.

TLV[TAG_2]

2-byte Crypto Object identifier

TLV[TAG_4]

Initialization Vector [Optional] [Conditional: only when the Crypto Object type equals CC_CIPHER and subtype is not including ECB]

Le

R-APDU Body

NA

R-APDU Trailer

SW

Description

SW_NO_ERROR

The command is handled successfully.

Parameters
  • [in] session_ctx: Session Context [0:kSE05x_pSession]

  • [in] objectID: objectID [1:kSE05x_TAG_1]

  • [in] cryptoObjectID: cryptoObjectID [2:kSE05x_TAG_2]

  • [in] IV: IV [3:kSE05x_TAG_4]

  • [in] IVLen: Length of IV

  • [in] operation: See SE05x_Cipher_Oper_t