This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new cdfe81ff4c8 crypto/siphash: avoid redefine name issue
cdfe81ff4c8 is described below

commit cdfe81ff4c8ed2c92e0ad25eb5b0eef0027dda5f
Author: makejian <[email protected]>
AuthorDate: Wed May 28 11:06:10 2025 +0800

    crypto/siphash: avoid redefine name issue
    
    Rename siphash related symbols to avoid conflicts with compiler-generated
    section names. Tricore-gcc produces function sections with '_end' suffix,
    which conflicts with siphash_end symbol.
    
    Signed-off-by: makejian <[email protected]>
---
 crypto/siphash.c         | 6 +++---
 include/crypto/siphash.h | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/crypto/siphash.c b/crypto/siphash.c
index 50603c67249..b74ab787e0f 100644
--- a/crypto/siphash.c
+++ b/crypto/siphash.c
@@ -126,11 +126,11 @@ void siphash_final(FAR void *dst, FAR SIPHASH_CTX *ctx, 
int rc, int rf)
 {
   uint64_t r;
 
-  htolem64(&r, siphash_end(ctx, rc, rf));
+  htolem64(&r, siphash_finish(ctx, rc, rf));
   memcpy(dst, &r, sizeof r);
 }
 
-uint64_t siphash_end(FAR SIPHASH_CTX *ctx, int rc, int rf)
+uint64_t siphash_finish(FAR SIPHASH_CTX *ctx, int rc, int rf)
 {
   uint64_t r;
   size_t left;
@@ -158,7 +158,7 @@ uint64_t siphash(FAR const SIPHASH_KEY *key,
 
   siphash_init(&ctx, key);
   siphash_update(&ctx, rc, rf, src, len);
-  return (siphash_end(&ctx, rc, rf));
+  return (siphash_finish(&ctx, rc, rf));
 }
 
 #define SIP_ROTL(x, b) ((x) << (b)) | ( (x) >> (64 - (b)))
diff --git a/include/crypto/siphash.h b/include/crypto/siphash.h
index e1c66363359..0748a2cc03e 100644
--- a/include/crypto/siphash.h
+++ b/include/crypto/siphash.h
@@ -75,20 +75,20 @@ typedef struct
 
 void siphash_init(FAR SIPHASH_CTX *, FAR const SIPHASH_KEY *);
 void siphash_update(FAR SIPHASH_CTX *, int, int, FAR const void *, size_t);
-uint64_t siphash_end(FAR SIPHASH_CTX *, int, int);
+uint64_t siphash_finish(FAR SIPHASH_CTX *, int, int);
 void siphash_final(FAR void *, FAR SIPHASH_CTX *, int, int);
 uint64_t siphash(FAR const SIPHASH_KEY *,
                  int, int, FAR const void *, size_t);
 
 #define SipHash24_Init(_c, _k)        siphash_init((_c), (_k))
 #define SipHash24_Update(_c, _p, _l)  siphash_update((_c), 2, 4, (_p), (_l))
-#define SipHash24_End(_d)             siphash_end((_d), 2, 4)
+#define SipHash24_Finish(_d)          siphash_finish((_d), 2, 4)
 #define SipHash24_Final(_d, _c)       siphash_final((_d), (_c), 2, 4)
 #define SipHash24(_k, _p, _l)         siphash((_k), 2, 4, (_p), (_l))
 
 #define SipHash48_Init(_c, _k)        siphash_init((_c), (_k))
 #define SipHash48_Update(_c, _p, _l)  siphash_update((_c), 4, 8, (_p), (_l))
-#define SipHash48_End(_d)             siphash_end((_d), 4, 8)
+#define SipHash48_Finish(_d)          siphash_finish((_d), 4, 8)
 #define SipHash48_Final(_d, _c)       siphash_final((_d), (_c), 4, 8)
 #define SipHash48(_k, _p, _l)         siphash((_k), 4, 8, (_p), (_l))
 

Reply via email to