Skip to content

Commit 8bedb2a

Browse files
committed
depends: libsodium: update to 1.0.21
1 parent fd81a15 commit 8bedb2a

File tree

2 files changed

+49
-4
lines changed

2 files changed

+49
-4
lines changed

contrib/depends/packages/libsodium.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package=libsodium
2-
$(package)_version=1.0.20
2+
$(package)_version=1.0.21
33
$(package)_download_path=https://download.libsodium.org/libsodium/releases/
44
$(package)_file_name=libsodium-$($(package)_version).tar.gz
5-
$(package)_sha256_hash=ebb65ef6ca439333c2bb41a0c1990587288da07f6c7fd07cb3a18cc18d30ce19
6-
$(package)_patches += fix-blake2b-symbol-naming.patch
5+
$(package)_sha256_hash=9e4285c7a419e82dedb0be63a72eea357d6943bc3e28e6735bf600dd4883feaf
6+
$(package)_patches=fix-aarch64.patch fix-blake2b-symbol-naming.patch
77

88
define $(package)_set_vars
99
$(package)_config_opts=--enable-static --disable-shared
@@ -13,7 +13,8 @@ endef
1313
define $(package)_preprocess_cmds
1414
rm -rf builds/msvc &&\
1515
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux/ && \
16-
patch -p1 -i $($(package)_patch_dir)/fix-blake2b-symbol-naming.patch
16+
patch -p1 -i $($(package)_patch_dir)/fix-blake2b-symbol-naming.patch && \
17+
patch -p1 -i $($(package)_patch_dir)/fix-aarch64.patch
1718
endef
1819

1920
define $(package)_config_cmds
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From 6702f69bef6044163acc7715e6ac7e430890ce78 Mon Sep 17 00:00:00 2001
2+
From: Frank Denis <[email protected]>
3+
Date: Wed, 7 Jan 2026 12:00:49 +0100
4+
Subject: [PATCH] Fix compilation with GCC on aarch64
5+
6+
Use unsigned NEON intrinsics everywhere
7+
8+
Fixes #1502
9+
10+
diff --git a/src/libsodium/crypto_ipcrypt/ipcrypt_armcrypto.c b/src/libsodium/crypto_ipcrypt/ipcrypt_armcrypto.c
11+
index c5a27e92..bad4ce38 100644
12+
--- a/src/libsodium/crypto_ipcrypt/ipcrypt_armcrypto.c
13+
+++ b/src/libsodium/crypto_ipcrypt/ipcrypt_armcrypto.c
14+
@@ -37,7 +37,7 @@ typedef uint64x2_t BlockVec;
15+
# define XOR128_3(a, b, c) veorq_u64(veorq_u64((a), (b)), (c))
16+
# define SET64x2(a, b) vsetq_lane_u64((uint64_t) (a), vmovq_n_u64((uint64_t) (b)), 1)
17+
# define BYTESHL128(a, b) \
18+
- vreinterpretq_u64_u8(vextq_s8(vdupq_n_s8(0), vreinterpretq_s8_u64(a), 16 - (b)))
19+
+ vreinterpretq_u64_u8(vextq_u8(vdupq_n_u8(0), vreinterpretq_u8_u64(a), 16 - (b)))
20+
21+
# define AES_XENCRYPT(block_vec, rkey) \
22+
vreinterpretq_u64_u8( \
23+
@@ -348,12 +348,12 @@ pfx_set_bit(uint8_t ip16[16], const unsigned int bit_index, const uint8_t bit_va
24+
static void
25+
pfx_shift_left(uint8_t ip16[16])
26+
{
27+
- BlockVec v = LOAD128(ip16);
28+
- const BlockVec shl = vshlq_n_u8(vreinterpretq_u8_u64(v), 1);
29+
- const BlockVec msb = vshrq_n_u8(vreinterpretq_u8_u64(v), 7);
30+
- const BlockVec zero = vdupq_n_u8(0);
31+
- const BlockVec carries = vextq_u8(vreinterpretq_u8_u64(msb), zero, 1);
32+
- v = vreinterpretq_u64_u8(vorrq_u8(shl, carries));
33+
+ BlockVec v = LOAD128(ip16);
34+
+ const uint8x16_t shl = vshlq_n_u8(vreinterpretq_u8_u64(v), 1);
35+
+ const uint8x16_t msb = vshrq_n_u8(vreinterpretq_u8_u64(v), 7);
36+
+ const uint8x16_t zero = vdupq_n_u8(0);
37+
+ const uint8x16_t carries = vextq_u8(msb, zero, 1);
38+
+ v = vreinterpretq_u64_u8(vorrq_u8(shl, carries));
39+
STORE128(ip16, v);
40+
}
41+
42+
--
43+
2.52.0
44+

0 commit comments

Comments
 (0)