Skip to content

Commit

Permalink
Added portability warnings and removed typedef 16bit
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenrong-wang committed Apr 16, 2024
1 parent 73599b0 commit 87c6c7c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
9 changes: 8 additions & 1 deletion hpcopr/now_md5.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@

#define FILEIO_BUFFER_SIZE 67108864 /* 64MB maximum memory buffer*/

/**
* Portability risk: The unsigned int does not always has 32 bits. It is *NOT*
* defined by standards. We assert that on all the target platforms of this
* project, that is, x86_64 with Windows/Linux/macOS, the unsigned int is 32 bit.
* This is an assertion! If you encounter any portability problems, please
* submit issues to this repository.
*
*/
typedef unsigned char uint_8bit;
typedef unsigned short uint_16bit;
typedef unsigned int uint_32bit;
typedef unsigned long long int uint_64bit;
typedef signed long long int int_64bit;
Expand Down
9 changes: 8 additions & 1 deletion hpcopr/now_sha256.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@

#define FILEIO_BUFFER_SIZE_SHA 67108864 /* 64MB maximum memory buffer*/

/**
* Portability risk: The unsigned int does not always has 32 bits. It is *NOT*
* defined by standards. We assert that on all the target platforms of this
* project, that is, x86_64 with Windows/Linux/macOS, the unsigned int is 32 bit.
* This is an assertion! If you encounter any portability problems, please
* submit issues to this repository.
*
*/
typedef unsigned char uint_8bit;
typedef unsigned short uint_16bit;
typedef unsigned int uint_32bit;
typedef unsigned long long int uint_64bit;
typedef signed long long int int_64bit;
Expand Down
10 changes: 8 additions & 2 deletions now-crypto/now-crypto-v3-aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@

#define CRYPTO_VERSION "0.3.0"

/**
* Portability risk: The unsigned int does not always has 32 bits. It is *NOT*
* defined by standards. We assert that on all the target platforms of this
* project, that is, x86_64 with Windows/Linux/macOS, the unsigned int is 32 bit.
* This is an assertion! If you encounter any portability problems, please
* submit issues to this repository.
*
*/
typedef unsigned char uint_8bit;
typedef unsigned short uint_16bit;
typedef unsigned int uint_32bit;
typedef unsigned long int uint_64bit;

/* Each expanded key is in format of 0xAABBCCDD, so 4X8bit=32bit */
typedef struct{
Expand Down

0 comments on commit 87c6c7c

Please sign in to comment.