-
Notifications
You must be signed in to change notification settings - Fork 704
re-vendor sha1 & update script location #3400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
weissi
wants to merge
1
commit into
apple:main
Choose a base branch
from
weissi:jw-revendor-sha1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+23
−34
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -44,7 +44,9 @@ | |
* implemented by Jun-ichiro itojun Itoh <[email protected]> | ||
*/ | ||
|
||
|
||
#include "include/CNIOSHA1.h" | ||
#include <stdint.h> | ||
#include <string.h> | ||
#if !defined(bzero) | ||
#define bzero(b,l) memset((b), '\0', (l)) | ||
|
@@ -57,15 +59,15 @@ | |
#elif defined(__linux__) || defined(__APPLE__) || defined(__wasm32__) | ||
#include <sys/types.h> | ||
#elif defined(_WIN32) || defined(_WIN64) | ||
#ifndef LITTLE_ENDIAN | ||
#define LITTLE_ENDIAN 1234 | ||
#endif | ||
#ifndef BIG_ENDIAN | ||
#define BIG_ENDIAN 4321 | ||
#endif | ||
#ifndef BYTE_ORDER | ||
#define BYTE_ORDER LITTLE_ENDIAN | ||
#endif | ||
#ifndef LITTLE_ENDIAN | ||
#define LITTLE_ENDIAN 1234 | ||
#endif | ||
#ifndef BIG_ENDIAN | ||
#define BIG_ENDIAN 4321 | ||
#endif | ||
#ifndef BYTE_ORDER | ||
#define BYTE_ORDER LITTLE_ENDIAN | ||
#endif | ||
#endif | ||
|
||
|
||
|
@@ -102,21 +104,21 @@ static uint32_t _K[] = { 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 }; | |
COUNT %= 64; \ | ||
ctxt->c.b64[0] += 8; \ | ||
if (COUNT % 64 == 0) \ | ||
sha1_step(ctxt); \ | ||
c_nio_sha1_step(ctxt); \ | ||
} | ||
|
||
#define PUTPAD(x) { \ | ||
ctxt->m.b8[(COUNT % 64)] = (x); \ | ||
COUNT++; \ | ||
COUNT %= 64; \ | ||
if (COUNT % 64 == 0) \ | ||
sha1_step(ctxt); \ | ||
c_nio_sha1_step(ctxt); \ | ||
} | ||
|
||
static void sha1_step(struct sha1_ctxt *); | ||
static void c_nio_sha1_step(struct sha1_ctxt *); | ||
|
||
static void | ||
sha1_step(struct sha1_ctxt *ctxt) | ||
c_nio_sha1_step(struct sha1_ctxt *ctxt) | ||
{ | ||
uint32_t a, b, c, d, e; | ||
size_t t, s; | ||
|
@@ -224,7 +226,7 @@ c_nio_sha1_pad(struct sha1_ctxt *ctxt) | |
bzero(&ctxt->m.b8[padstart], padlen); | ||
COUNT += padlen; | ||
COUNT %= 64; | ||
sha1_step(ctxt); | ||
c_nio_sha1_step(ctxt); | ||
padstart = COUNT % 64; /* should be 0 */ | ||
padlen = 64 - padstart; /* should be 64 */ | ||
} | ||
|
@@ -264,7 +266,7 @@ c_nio_sha1_loop(struct sha1_ctxt *ctxt, const uint8_t *input, size_t len) | |
COUNT %= 64; | ||
ctxt->c.b64[0] += copysiz * 8; | ||
if (COUNT % 64 == 0) | ||
sha1_step(ctxt); | ||
c_nio_sha1_step(ctxt); | ||
off += copysiz; | ||
} | ||
} | ||
|
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are required for CXX interop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh, are we compiling C headers in C++ mode for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unavoidably so, yeah. CXX interop is viral backwards through the dependency chain (i.e. if module X compiles in CXX mode then so does everything it depends on), so we have to tolerate the user switching that on when they use us.