You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now the `build` folder contains the `PKCS7.o` object file. Use it together with the `PKCS7.h` header file from `include` folder to work with PKCS7 padding in your project.
44
+
45
+
For PKCS7 padding, use this function with appropriate structure:
46
+
47
+
```C
48
+
/*
49
+
A pointer to this structure is returned from the function addPadding().
50
+
The structure contains result of adding PKCS7 padding.
51
+
*/
52
+
typedefstruct {
53
+
void* dataWithPadding; /* result of adding padding to the data */
54
+
uint64_t dataLengthWithPadding; /* length of the result */
55
+
uint8_t valueOfByteForPadding; /* used for padding byte value */
56
+
} PKCS7_Padding;
57
+
58
+
/*
59
+
Applies PKCS7 padding to data.
60
+
Your data at the provided address does not change. A copy is created, to which the adding padding is applied.
Also note the `paddingBlockSize` constants from the `PKCS7.h` file, which can be used to pass to addPadding() as the third parameter. For convenience, you can set your own `BLOCK_SIZE_CUSTOM_VALUE` value to this enum:
87
+
88
+
```C
89
+
/*
90
+
Examples of commonly used block sizes for data padding.
91
+
WARNING: block size for PKCS7 padding can be 0 < BLOCK_SIZE < 256 bytes.
0 commit comments