Skip to content

Commit e11e107

Browse files
committed
Add byte-swapping utility function for endian conversion
- Implement swab32() function to perform 32-bit byte-order reversal - Provides a static inline utility for converting between big and little-endian representations - Supports potential cross-platform hashing requirements in VIPStar implementation
1 parent 16d97e0 commit e11e107

File tree

3 files changed

+101
-90
lines changed

3 files changed

+101
-90
lines changed

package-lock.json

Lines changed: 90 additions & 87 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
},
1717
"dependencies": {
1818
"bindings": "^1.5.0",
19-
"nan": "^2.22.0"
19+
"nan": "^2.22.2"
2020
},
2121
"devDependencies": {
22-
"@babel/core": "7.26.0",
22+
"@babel/core": "7.26.9",
2323
"@babel/register": "^7.25.9",
24-
"mocha": "^11.0.1"
24+
"mocha": "^11.1.0"
2525
},
2626
"keywords": [
2727
"argon2",

src/vipstar.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ static inline void sha256_init_256(__m256i *state)
2121
}
2222
#endif /* __SSE2__ */
2323

24+
static inline uint32_t swab32(uint32_t x)
25+
{
26+
return ((x & 0x000000FF) << 24) |
27+
((x & 0x0000FF00) << 8) |
28+
((x & 0x00FF0000) >> 8) |
29+
((x & 0xFF000000) >> 24);
30+
}
31+
2432
static inline void sha256d_preextend(uint32_t *W)
2533
{
2634
W[16] = s1(W[14]) + W[9] + s0(W[1]) + W[0];

0 commit comments

Comments
 (0)