BALTECH SDK wrapper functions reference
crypto.h
Go to the documentation of this file.
1 
10 #ifndef __BRP_BALTECH_SDK_CMDS_CRYPTO_H__
11 #define __BRP_BALTECH_SDK_CMDS_CRYPTO_H__
12 #include "../typedefs.h"
16 #define BRP_Crypto_CrptErrInvalidBlock BRP_ERR_STATUS(0x0200, 0x01)
17 
20 #define BRP_Crypto_CrptErrAuth BRP_ERR_STATUS(0x0200, 0x02)
21 
24 #define BRP_Crypto_CrptErrKeyNotFound BRP_ERR_STATUS(0x0200, 0x03)
25 
28 #define BRP_Crypto_CrptErrWriteConfigkey BRP_ERR_STATUS(0x0200, 0x04)
29 
34 #define BRP_Crypto_CrptErrInvalidKey BRP_ERR_STATUS(0x0200, 0x05)
35 typedef struct {
37  unsigned KeyIndex;
54 #ifdef BRP_SUPPORT_LEGACY_METHODS
55 brp_errcode brp_Crypto_EncryptBlock(brp_protocol protocol, unsigned KeyIndex, brp_buf KeyValue, brp_buf Block, brp_buf* EncryptedBlock, brp_mempool *mempool);
56 #else
58 #endif
59 typedef struct {
61  unsigned KeyIndex;
78 #ifdef BRP_SUPPORT_LEGACY_METHODS
79 brp_errcode brp_Crypto_DecryptBlock(brp_protocol protocol, unsigned KeyIndex, brp_buf KeyValue, brp_buf Block, brp_buf* UnencryptedBlock, brp_mempool *mempool);
80 #else
82 #endif
83 typedef struct {
85  unsigned KeyIndex;
89  size_t Buffer_len;
112 #ifdef BRP_SUPPORT_LEGACY_METHODS
113 brp_errcode brp_Crypto_EncryptBuffer(brp_protocol protocol, unsigned KeyIndex, brp_buf KeyValue, brp_buf InitialVector, brp_buf Buffer, size_t Buffer_len, brp_buf* NextInitialVector, brp_buf* EncryptedBuffer, size_t* EncryptedBuffer_len, brp_mempool *mempool);
114 #else
116 #endif
117 typedef struct {
119  unsigned KeyIndex;
123  size_t Buffer_len;
146 #ifdef BRP_SUPPORT_LEGACY_METHODS
147 brp_errcode brp_Crypto_DecryptBuffer(brp_protocol protocol, unsigned KeyIndex, brp_buf KeyValue, brp_buf InitialVector, brp_buf Buffer, size_t Buffer_len, brp_buf* NextInitialVector, brp_buf* UnencryptedBuffer, size_t* UnencryptedBuffer_len, brp_mempool *mempool);
148 #else
150 #endif
151 typedef struct {
153  unsigned KeyVersion;
155  unsigned EmbeddedKeyPos;
157  size_t Buffer_len;
186 #ifdef BRP_SUPPORT_LEGACY_METHODS
187 brp_errcode brp_Crypto_BalKeyEncryptBuffer(brp_protocol protocol, unsigned KeyVersion, unsigned EmbeddedKeyIndex, unsigned EmbeddedKeyPos, brp_buf Buffer, size_t Buffer_len, brp_buf InitialVector, size_t InitialVector_len, brp_buf* EncryptedBuffer, size_t* EncryptedBuffer_len, brp_buf* NextInitialVector, size_t* NextInitialVector_len, brp_mempool *mempool);
188 #else
190 #endif
191 typedef struct {
193  unsigned KeyIndex;
195  unsigned* KeySignature;
206 #ifdef BRP_SUPPORT_LEGACY_METHODS
207 brp_errcode brp_Crypto_GetKeySig(brp_protocol protocol, unsigned KeyIndex, brp_buf KeyValue, unsigned* KeySignature);
208 #else
210 #endif
211 typedef struct {
213  unsigned KeyIndex;
226 #ifdef BRP_SUPPORT_LEGACY_METHODS
227 brp_errcode brp_Crypto_CopyConfigKey(brp_protocol protocol, unsigned KeyIndex, bool ForceDefaultKey);
228 #else
230 #endif
231 #endif
232 
brp_buf * EncryptedBlock
Definition: crypto.h:40
brp_errcode brp_Crypto_CopyConfigKey(brp_Crypto_CopyConfigKey_t params)
Copies the configuration card key 0x0202/0x85 (Device/Run/ConfigCardEncryptKey) to the Custom/Crypto/...
brp_errcode brp_Crypto_EncryptBuffer(brp_Crypto_EncryptBuffer_t params)
This command encrypts a variable length buffer given in the Buffer parameter using the SkipJack algor...
unsigned int brp_errcode
This type is used library-wide for passing error codes in the return value of functions.
Definition: errorcodes.h:23
size_t * EncryptedBuffer_len
Definition: crypto.h:92
struct brp_protocol_t * brp_protocol
This is a generic handle of a protocol.
Definition: protocol.h:34
brp_protocol protocol
Definition: crypto.h:212
brp_buf * UnencryptedBlock
Definition: crypto.h:64
struct brp_mempool_object_t * brp_mempool
mempool handle.
Definition: mempool.h:29
brp_mempool * mempool
Definition: crypto.h:65
brp_protocol protocol
Definition: crypto.h:60
brp_buf * NextInitialVector
Definition: crypto.h:90
brp_errcode brp_Crypto_GetKeySig(brp_Crypto_GetKeySig_t params)
Returns a signature of the ConfigurationKey to identify the MasterCard needed for this reader...
brp_buf * NextInitialVector
Definition: crypto.h:124
brp_protocol protocol
Definition: crypto.h:84
brp_protocol protocol
Definition: crypto.h:192
brp_mempool * mempool
Definition: crypto.h:41
size_t * UnencryptedBuffer_len
Definition: crypto.h:126
brp_mempool * mempool
Definition: crypto.h:127
brp_buf * EncryptedBuffer
Definition: crypto.h:91
brp_protocol protocol
Definition: crypto.h:118
brp_errcode brp_Crypto_DecryptBuffer(brp_Crypto_DecryptBuffer_t params)
This command decrypts a variable length buffer given in the Buffer parameter using the SkipJack algor...
brp_buf * UnencryptedBuffer
Definition: crypto.h:125
brp_errcode brp_Crypto_EncryptBlock(brp_Crypto_EncryptBlock_t params)
This command encrypts an 8-Byte data block given in the Block parameter using the SkipJack algorithm...
unsigned char * brp_buf
represents a pointer to a protocol data buffer.
Definition: common.h:61
brp_errcode brp_Crypto_BalKeyEncryptBuffer(brp_Crypto_BalKeyEncryptBuffer_t params)
This command is a special version of the brp_Crypto_EncryptBuffer() command which always uses a custo...
brp_mempool * mempool
Definition: crypto.h:93
brp_protocol protocol
Definition: crypto.h:36
unsigned * KeySignature
Definition: crypto.h:195
brp_errcode brp_Crypto_DecryptBlock(brp_Crypto_DecryptBlock_t params)
This command decrypts an 8-Byte data block given in the Block parameter using the SkipJack algorithm...