> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/crypt_8h_source.md).

# crypt.h

[Go to the documentation of this file.](/s-adk-5.1-programmers-guide/readme/files/dir_44d926a17fc606d3c25449ba60427c63/dir_048f823fee1bfb22502a8732b9a001aa/crypt_8h.md)

```cpp
 1 /****************************************************************************
 2 * Product: InFusion
 3 * Company: Verifone
 4 * Author: GSS R&D Germany
 5 * Content: SDI-Server
 6 ****************************************************************************/
 7 
 8 #ifndef _CRYPT_H_
 9 #define _CRYPT_H_
 10 
 11 /* input types used for functions calculate_CMAC() and check_CMAC() */
 12 enum Inputype
 13 {
 14  INPUT_TYPE_FILE,
 15  INPUT_TYPE_BUFFER,
 16 };
 17 
 18 /* system authentication steps, for more details see function system_Auth() */
 19 enum AuthStep
 20 {
 21  AuthStep_1 = 0,
 22  AuthStep_2
 23 };
 24 
 25 #ifdef __cplusplus
 26 extern "C"
 27 {
 28 #endif
 29 
 34 int check_AuthScript();
 35 
 55 int system_Auth(enum AuthStep as,
 56  unsigned char *in, unsigned short in_size,
 57  unsigned char *out, unsigned short *out_size);
 58 
 68 int calculate_CMAC(Inputype type,
 69  const char *fileToMAC,
 70  unsigned char *dataToMAC,
 71  unsigned dataSize,
 72  unsigned char *MAC);
 73 
 83 int check_CMAC(Inputype type,
 84  const char *filename,
 85  unsigned char *data,
 86  unsigned dataSize,
 87  unsigned char *MAC);
 88 
 97 int encrypt_Data(unsigned char *data,
 98  unsigned long dataSize,
 99  unsigned char *encryptedData,
 100  unsigned long *encryptedDataSize);
 101 
 110 int decrypt_Data(unsigned char *data,
 111  unsigned long dataSize,
 112  unsigned char *decryptedData,
 113  unsigned long *decryptedDataSize);
 114 
 119 int calculate_MD5(const char *file, unsigned char *checkSum);
 120 
 121 #ifdef __cplusplus
 122 }
 123 #endif
 124 
 125 #endif // _CRYPT_H_
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/crypt_8h_source.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
