-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
- Loading branch information
Showing
12 changed files
with
967 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/*************************** sha-private.h ***************************/ | ||
/********************** See RFC 4634 for details *********************/ | ||
#ifndef _SHA_PRIVATE__H | ||
#define _SHA_PRIVATE__H | ||
/* | ||
* These definitions are defined in FIPS-180-2, section 4.1. | ||
* Ch() and Maj() are defined identically in sections 4.1.1, | ||
* 4.1.2 and 4.1.3. | ||
* | ||
* The definitions used in FIPS-180-2 are as follows: | ||
*/ | ||
|
||
#ifndef USE_MODIFIED_MACROS | ||
#define SHA_Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) | ||
#define SHA_Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) | ||
|
||
#else /* USE_MODIFIED_MACROS */ | ||
/* | ||
* The following definitions are equivalent and potentially faster. | ||
*/ | ||
|
||
#define SHA_Ch(x, y, z) (((x) & ((y) ^ (z))) ^ (z)) | ||
#define SHA_Maj(x, y, z) (((x) & ((y) | (z))) | ((y) & (z))) | ||
#endif /* USE_MODIFIED_MACROS */ | ||
|
||
#define SHA_Parity(x, y, z) ((x) ^ (y) ^ (z)) | ||
|
||
#endif /* _SHA_PRIVATE__H */ |
Oops, something went wrong.