Skip to content

Commit

Permalink
Update libsodium with support for visionOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Sep 9, 2023
1 parent f745e8c commit 68663d1
Show file tree
Hide file tree
Showing 148 changed files with 9,452 additions and 24 deletions.
80 changes: 57 additions & 23 deletions Clibsodium.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,42 @@
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>libsodium.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64</string>
<key>LibraryPath</key>
<string>libsodium.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>libsodium.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>watchos-arm64_i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>libsodium.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>watchos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>libsodium.a</string>
Expand All @@ -29,17 +65,15 @@
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_i386_x86_64-simulator</string>
<string>xros-arm64-simulator</string>
<key>LibraryPath</key>
<string>libsodium.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<string>xros</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
Expand All @@ -49,33 +83,38 @@
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64</string>
<string>ios-arm64_i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>libsodium.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>libsodium.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7_armv7s</string>
<string>tvos-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>libsodium.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
<string>armv7s</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<string>tvos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
Expand All @@ -101,55 +140,50 @@
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>watchos-arm64_i386_x86_64-simulator</string>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>libsodium.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>watchos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
<string>macos</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>libsodium.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<string>xros-arm64</string>
<key>LibraryPath</key>
<string>libsodium.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
<string>xros</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>libsodium.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64_x86_64-simulator</string>
<string>ios-arm64_armv7_armv7s</string>
<key>LibraryPath</key>
<string>libsodium.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
<string>armv7</string>
<string>armv7s</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ extern "C" {
SODIUM_EXPORT_WEAK
int sodium_runtime_has_neon(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_armcrypto(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_sse2(void);

Expand Down
Binary file modified Clibsodium.xcframework/ios-arm64_armv7_armv7s/libsodium.a
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ extern "C" {
SODIUM_EXPORT_WEAK
int sodium_runtime_has_neon(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_armcrypto(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_sse2(void);

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ extern "C" {
SODIUM_EXPORT_WEAK
int sodium_runtime_has_neon(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_armcrypto(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_sse2(void);

Expand Down
Binary file modified Clibsodium.xcframework/ios-arm64_x86_64-maccatalyst/libsodium.a
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ extern "C" {
SODIUM_EXPORT_WEAK
int sodium_runtime_has_neon(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_armcrypto(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_sse2(void);

Expand Down
Binary file modified Clibsodium.xcframework/macos-arm64_x86_64/libsodium.a
Binary file not shown.
3 changes: 3 additions & 0 deletions Clibsodium.xcframework/tvos-arm64/Headers/sodium/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ extern "C" {
SODIUM_EXPORT_WEAK
int sodium_runtime_has_neon(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_armcrypto(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_sse2(void);

Expand Down
Binary file modified Clibsodium.xcframework/tvos-arm64/libsodium.a
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ extern "C" {
SODIUM_EXPORT_WEAK
int sodium_runtime_has_neon(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_armcrypto(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_sse2(void);

Expand Down
Binary file modified Clibsodium.xcframework/tvos-arm64_x86_64-simulator/libsodium.a
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ extern "C" {
SODIUM_EXPORT_WEAK
int sodium_runtime_has_neon(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_armcrypto(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_sse2(void);

Expand Down
Binary file modified Clibsodium.xcframework/watchos-arm64_arm64_32_armv7k/libsodium.a
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ extern "C" {
SODIUM_EXPORT_WEAK
int sodium_runtime_has_neon(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_armcrypto(void);

SODIUM_EXPORT_WEAK
int sodium_runtime_has_sse2(void);

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Clibsodium {
header "sodium.h"
export *
}
69 changes: 69 additions & 0 deletions Clibsodium.xcframework/xros-arm64-simulator/Headers/sodium.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

#ifndef sodium_H
#define sodium_H

#include "sodium/version.h"

#include "sodium/core.h"
#include "sodium/crypto_aead_aes256gcm.h"
#include "sodium/crypto_aead_chacha20poly1305.h"
#include "sodium/crypto_aead_xchacha20poly1305.h"
#include "sodium/crypto_auth.h"
#include "sodium/crypto_auth_hmacsha256.h"
#include "sodium/crypto_auth_hmacsha512.h"
#include "sodium/crypto_auth_hmacsha512256.h"
#include "sodium/crypto_box.h"
#include "sodium/crypto_box_curve25519xsalsa20poly1305.h"
#include "sodium/crypto_core_hsalsa20.h"
#include "sodium/crypto_core_hchacha20.h"
#include "sodium/crypto_core_salsa20.h"
#include "sodium/crypto_core_salsa2012.h"
#include "sodium/crypto_core_salsa208.h"
#include "sodium/crypto_generichash.h"
#include "sodium/crypto_generichash_blake2b.h"
#include "sodium/crypto_hash.h"
#include "sodium/crypto_hash_sha256.h"
#include "sodium/crypto_hash_sha512.h"
#include "sodium/crypto_kdf.h"
#include "sodium/crypto_kdf_blake2b.h"
#include "sodium/crypto_kx.h"
#include "sodium/crypto_onetimeauth.h"
#include "sodium/crypto_onetimeauth_poly1305.h"
#include "sodium/crypto_pwhash.h"
#include "sodium/crypto_pwhash_argon2i.h"
#include "sodium/crypto_scalarmult.h"
#include "sodium/crypto_scalarmult_curve25519.h"
#include "sodium/crypto_secretbox.h"
#include "sodium/crypto_secretbox_xsalsa20poly1305.h"
#include "sodium/crypto_secretstream_xchacha20poly1305.h"
#include "sodium/crypto_shorthash.h"
#include "sodium/crypto_shorthash_siphash24.h"
#include "sodium/crypto_sign.h"
#include "sodium/crypto_sign_ed25519.h"
#include "sodium/crypto_stream.h"
#include "sodium/crypto_stream_chacha20.h"
#include "sodium/crypto_stream_salsa20.h"
#include "sodium/crypto_stream_xsalsa20.h"
#include "sodium/crypto_verify_16.h"
#include "sodium/crypto_verify_32.h"
#include "sodium/crypto_verify_64.h"
#include "sodium/randombytes.h"
#include "sodium/randombytes_internal_random.h"
#include "sodium/randombytes_sysrandom.h"
#include "sodium/runtime.h"
#include "sodium/utils.h"

#ifndef SODIUM_LIBRARY_MINIMAL
# include "sodium/crypto_box_curve25519xchacha20poly1305.h"
# include "sodium/crypto_core_ed25519.h"
# include "sodium/crypto_core_ristretto255.h"
# include "sodium/crypto_scalarmult_ed25519.h"
# include "sodium/crypto_scalarmult_ristretto255.h"
# include "sodium/crypto_secretbox_xchacha20poly1305.h"
# include "sodium/crypto_pwhash_scryptsalsa208sha256.h"
# include "sodium/crypto_stream_salsa2012.h"
# include "sodium/crypto_stream_salsa208.h"
# include "sodium/crypto_stream_xchacha20.h"
#endif

#endif
28 changes: 28 additions & 0 deletions Clibsodium.xcframework/xros-arm64-simulator/Headers/sodium/core.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

#ifndef sodium_core_H
#define sodium_core_H

#include "export.h"

#ifdef __cplusplus
extern "C" {
#endif

SODIUM_EXPORT
int sodium_init(void)
__attribute__ ((warn_unused_result));

/* ---- */

SODIUM_EXPORT
int sodium_set_misuse_handler(void (*handler)(void));

SODIUM_EXPORT
void sodium_misuse(void)
__attribute__ ((noreturn));

#ifdef __cplusplus
}
#endif

#endif
Loading

0 comments on commit 68663d1

Please sign in to comment.