switching to using stdint types

This commit is contained in:
GRISHNOV
2020-11-18 00:49:46 +03:00
parent 3c5aea0bde
commit 1851762724
2 changed files with 21 additions and 20 deletions

View File

@@ -17,9 +17,9 @@ typedef enum {
The structure contains result of adding PKCS7 padding.
*/
typedef struct {
void* dataWithPadding; /* result of adding padding to the data */
unsigned char dataLengthWithPadding; /* length of the result */
unsigned char valueOfByteForPadding; /* used for padding byte value */
void* dataWithPadding; /* result of adding padding to the data */
uint64_t dataLengthWithPadding; /* length of the result */
uint8_t valueOfByteForPadding; /* used for padding byte value */
} PKCS7_Padding;
/*
@@ -27,7 +27,7 @@ typedef struct {
Your data at the provided address does not change. A copy is created, to which the adding padding is applied.
WARNING: use only 0 < BLOCK_SIZE < 256
*/
PKCS7_Padding* addPadding(const void* const data, const unsigned int dataLength, const unsigned char BLOCK_SIZE);
PKCS7_Padding* addPadding(const void* const data, const uint64_t dataLength, const uint8_t BLOCK_SIZE);
/*
@@ -35,15 +35,15 @@ PKCS7_Padding* addPadding(const void* const data, const unsigned int dataLength,
The structure contains result of removing PKCS7 padding.
*/
typedef struct {
void* dataWithoutPadding; /* result of remove padding from data */
unsigned char dataLengthWithoutPadding; /* length of the result */
unsigned char valueOfRemovedByteFromData; /* value of byte that was used for padding */
void* dataWithoutPadding; /* result of remove padding from data */
uint64_t dataLengthWithoutPadding; /* length of the result */
uint8_t valueOfRemovedByteFromData; /* value of byte that was used for padding */
} PKCS7_unPadding;
/*
Remove PKCS7 padding from data.
Your data at the provided address does not change. A copy is created, to which the removing padding is applied.
*/
PKCS7_unPadding* removePadding(const void* const data, const unsigned int dataLength);
PKCS7_unPadding* removePadding(const void* const data, const uint64_t dataLength);
#endif // PKCS7_H