What changed, and why it matters
This commit simply removes unused helper functions from a cryptographic source file to silence compiler warnings. No behavior changes, no bug fixes, and no security issue is present in the diff.
No security action required. Treat as normal code hygiene cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit deletes four static inline functions (load32, load48, store48, rotr32) from src/crypto/blake2b.c because they are unused elsewhere in the translation unit. Static inline functions that are not referenced produce ‘unused-function’ warnings; removing them is a routine cleanup. The remaining functions (load64_native, store32, store64, rotr64) are left untouched. There is no functional change to the Blake2b implementation.
Changed components
src/crypto/blake2b.cInspect captured patch +0 / −45
diff --git a/src/crypto/blake2b.c b/src/crypto/blake2b.c
index 7e8be78..6c0d78e 100644
--- a/src/crypto/blake2b.c
+++ b/src/crypto/blake2b.c
@@ -66,21 +66,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
/* Argon2 Team - End Code */
-static FORCE_INLINE uint32_t load32(const void *src) {
-#if defined(NATIVE_LITTLE_ENDIAN)
- uint32_t w;
- memcpy(&w, src, sizeof w);
- return w;
-#else
- const uint8_t *p = (const uint8_t *)src;
- uint32_t w = *p++;
- w |= (uint32_t)(*p++) << 8;
- w |= (uint32_t)(*p++) << 16;
- w |= (uint32_t)(*p++) << 24;
- return w;
-#endif
-}
-
static FORCE_INLINE uint64_t load64_native(const void *src) {
uint64_t w;
memcpy(&w, src, sizeof w);
@@ -150,36 +135,6 @@ static FORCE_INLINE void store64(void *dst, uint64_t w) {
/// BEGIN: blake2-impl.h
-static FORCE_INLINE uint64_t load48(const void *src) {
- const uint8_t *p = (const uint8_t *)src;
- uint64_t w = *p++;
- w |= (uint64_t)(*p++) << 8;
- w |= (uint64_t)(*p++) << 16;
- w |= (uint64_t)(*p++) << 24;
- w |= (uint64_t)(*p++) << 32;
- w |= (uint64_t)(*p++) << 40;
- return w;
-}
-
-static FORCE_INLINE void store48(void *dst, uint64_t w) {
- uint8_t *p = (uint8_t *)dst;
- *p++ = (uint8_t)w;
- w >>= 8;
- *p++ = (uint8_t)w;
- w >>= 8;
- *p++ = (uint8_t)w;
- w >>= 8;
- *p++ = (uint8_t)w;
- w >>= 8;
- *p++ = (uint8_t)w;
- w >>= 8;
- *p++ = (uint8_t)w;
-}
-
-static FORCE_INLINE uint32_t rotr32(const uint32_t w, const unsigned c) {
- return (w >> c) | (w << (32 - c));
-}
-
static FORCE_INLINE uint64_t rotr64(const uint64_t w, const unsigned c) {
return (w >> c) | (w << (64 - c));
}
Why this scored 14/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.