Skip to content

Commit ecbc16a

Browse files
authored
Bump the HACL* revision. (#133226)
Bump the HACL* revision to include iOS platform identification.
1 parent 6e907c4 commit ecbc16a

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

Misc/sbom.spdx.json

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

Modules/_hacl/Lib_Memzero0.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@
1010

1111
#if defined(__APPLE__) && defined(__MACH__)
1212
#include <AvailabilityMacros.h>
13+
// memset_s is available from macOS 10.9, iOS 7, watchOS 2, and on all tvOS and visionOS versions.
14+
# if (defined(MAC_OS_X_VERSION_MIN_REQUIRED) && (MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9))
15+
# define APPLE_HAS_MEMSET_S 1
16+
# elif (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_0))
17+
# define APPLE_HAS_MEMSET_S 1
18+
# elif (defined(TARGET_OS_TV) && TARGET_OS_TV)
19+
# define APPLE_HAS_MEMSET_S 1
20+
# elif (defined(__WATCH_OS_VERSION_MIN_REQUIRED) && (__WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_2_0))
21+
# define APPLE_HAS_MEMSET_S 1
22+
# elif (defined(TARGET_OS_VISION) && TARGET_OS_VISION)
23+
# define APPLE_HAS_MEMSET_S 1
24+
# else
25+
# define APPLE_HAS_MEMSET_S 0
26+
# endif
1327
#endif
1428

1529
#if (defined(__APPLE__) && defined(__MACH__)) || defined(__linux__) || defined(__OpenBSD__)
@@ -41,7 +55,7 @@ void Lib_Memzero0_memzero0(void *dst, uint64_t len) {
4155

4256
#ifdef _WIN32
4357
SecureZeroMemory(dst, len_);
44-
#elif defined(__APPLE__) && defined(__MACH__) && defined(MAC_OS_X_VERSION_MIN_REQUIRED) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1090)
58+
#elif defined(__APPLE__) && defined(__MACH__) && APPLE_HAS_MEMSET_S
4559
memset_s(dst, len_, 0, len_);
4660
#elif (defined(__linux__) && !defined(LINUX_NO_EXPLICIT_BZERO)) || defined(__FreeBSD__) || defined(__OpenBSD__)
4761
explicit_bzero(dst, len_);
@@ -52,7 +66,7 @@ void Lib_Memzero0_memzero0(void *dst, uint64_t len) {
5266
#warning "Your platform does not support any safe implementation of memzero -- consider a pull request!"
5367
volatile unsigned char *volatile dst_ = (volatile unsigned char *volatile) dst;
5468
size_t i = 0U;
55-
while (i < len)
69+
while (i < len_)
5670
dst_[i++] = 0U;
5771
#endif
5872
}

Modules/_hacl/refresh.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fi
2222

2323
# Update this when updating to a new version after verifying that the changes
2424
# the update brings in are good.
25-
expected_hacl_star_rev=322f6d58290e0ed7f4ecb84fcce12917aa0f594b
25+
expected_hacl_star_rev=7720f6d4fc0468a99d5ea6120976bcc271e42727
2626

2727
hacl_dir="$(realpath "$1")"
2828
cd "$(dirname "$0")"

0 commit comments

Comments
 (0)