uringmachine 0.15 → 0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +3 -0
- data/.gitmodules +4 -0
- data/CHANGELOG.md +12 -0
- data/TODO.md +12 -3
- data/examples/bm_send.rb +86 -0
- data/ext/um/um.c +28 -1
- data/ext/um/um.h +3 -0
- data/ext/um/um_class.c +17 -0
- data/ext/um/um_stream_class.c +0 -1
- data/ext/um/um_utils.c +38 -15
- data/lib/uringmachine/version.rb +1 -1
- data/lib/uringmachine.rb +4 -3
- data/test/test_um.rb +76 -0
- data/vendor/libressl/.github/scripts/changelog.sh +74 -0
- data/vendor/libressl/.github/workflows/android.yml +35 -0
- data/vendor/libressl/.github/workflows/cifuzz.yml +33 -0
- data/vendor/libressl/.github/workflows/cmake-config.yml +98 -0
- data/vendor/libressl/.github/workflows/coverity.yml +69 -0
- data/vendor/libressl/.github/workflows/emscripten.yml +71 -0
- data/vendor/libressl/.github/workflows/fedora-rawhide.yml +39 -0
- data/vendor/libressl/.github/workflows/freebsd.yml +71 -0
- data/vendor/libressl/.github/workflows/linux.yml +71 -0
- data/vendor/libressl/.github/workflows/macos.yml +37 -0
- data/vendor/libressl/.github/workflows/release.yml +81 -0
- data/vendor/libressl/.github/workflows/rust-openssl.yml +47 -0
- data/vendor/libressl/.github/workflows/solaris.yml +37 -0
- data/vendor/libressl/.github/workflows/windows.yml +70 -0
- data/vendor/libressl/.gitignore +333 -0
- data/vendor/libressl/CMakeLists.txt +581 -0
- data/vendor/libressl/COPYING +133 -0
- data/vendor/libressl/ChangeLog +3280 -0
- data/vendor/libressl/FindLibreSSL.cmake +232 -0
- data/vendor/libressl/LibreSSLConfig.cmake.in +36 -0
- data/vendor/libressl/Makefile.am +60 -0
- data/vendor/libressl/Makefile.am.common +20 -0
- data/vendor/libressl/OPENBSD_BRANCH +1 -0
- data/vendor/libressl/README.md +238 -0
- data/vendor/libressl/README.mingw.md +43 -0
- data/vendor/libressl/apps/CMakeLists.txt +18 -0
- data/vendor/libressl/apps/Makefile.am +5 -0
- data/vendor/libressl/apps/nc/CMakeLists.txt +67 -0
- data/vendor/libressl/apps/nc/Makefile.am +64 -0
- data/vendor/libressl/apps/nc/compat/accept4.c +17 -0
- data/vendor/libressl/apps/nc/compat/readpassphrase.c +205 -0
- data/vendor/libressl/apps/nc/compat/socket.c +29 -0
- data/vendor/libressl/apps/nc/compat/sys/socket.h +30 -0
- data/vendor/libressl/apps/ocspcheck/CMakeLists.txt +44 -0
- data/vendor/libressl/apps/ocspcheck/Makefile.am +45 -0
- data/vendor/libressl/apps/ocspcheck/compat/.gitignore +0 -0
- data/vendor/libressl/apps/openssl/CMakeLists.txt +97 -0
- data/vendor/libressl/apps/openssl/Makefile.am +108 -0
- data/vendor/libressl/apps/openssl/apps_win.c +138 -0
- data/vendor/libressl/apps/openssl/certhash_win.c +13 -0
- data/vendor/libressl/apps/openssl/compat/clock_gettime_osx.c +26 -0
- data/vendor/libressl/apps/openssl/compat/poll_win.c +329 -0
- data/vendor/libressl/appveyor.yml +53 -0
- data/vendor/libressl/autogen.sh +15 -0
- data/vendor/libressl/check-release.sh +86 -0
- data/vendor/libressl/cmake_export_symbol.cmake +71 -0
- data/vendor/libressl/cmake_uninstall.cmake.in +36 -0
- data/vendor/libressl/config +17 -0
- data/vendor/libressl/configure.ac +165 -0
- data/vendor/libressl/crypto/CMakeLists.txt +863 -0
- data/vendor/libressl/crypto/Makefile.am +962 -0
- data/vendor/libressl/crypto/Makefile.am.arc4random +46 -0
- data/vendor/libressl/crypto/Makefile.am.elf-mips +14 -0
- data/vendor/libressl/crypto/Makefile.am.elf-mips64 +14 -0
- data/vendor/libressl/crypto/Makefile.am.elf-x86_64 +35 -0
- data/vendor/libressl/crypto/Makefile.am.macosx-x86_64 +35 -0
- data/vendor/libressl/crypto/Makefile.am.masm-x86_64 +22 -0
- data/vendor/libressl/crypto/Makefile.am.mingw64-x86_64 +23 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_darwin.c +60 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_linux.c +62 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_none.c +26 -0
- data/vendor/libressl/crypto/arch/aarch64/crypto_cpu_caps_windows.c +36 -0
- data/vendor/libressl/crypto/arch/loongarch64/crypto_arch.h +21 -0
- data/vendor/libressl/crypto/arch/mips/crypto_arch.h +21 -0
- data/vendor/libressl/crypto/bn/arch/loongarch64/bn_arch.h +23 -0
- data/vendor/libressl/crypto/bn/arch/mips/bn_arch.h +24 -0
- data/vendor/libressl/crypto/compat/.gitignore +31 -0
- data/vendor/libressl/crypto/compat/arc4random.h +41 -0
- data/vendor/libressl/crypto/compat/b_win.c +55 -0
- data/vendor/libressl/crypto/compat/bsd-asprintf.c +96 -0
- data/vendor/libressl/crypto/compat/crypto_lock_win.c +56 -0
- data/vendor/libressl/crypto/compat/explicit_bzero_win.c +13 -0
- data/vendor/libressl/crypto/compat/freezero.c +32 -0
- data/vendor/libressl/crypto/compat/getdelim.c +78 -0
- data/vendor/libressl/crypto/compat/getline.c +40 -0
- data/vendor/libressl/crypto/compat/getopt_long.c +528 -0
- data/vendor/libressl/crypto/compat/getpagesize.c +18 -0
- data/vendor/libressl/crypto/compat/getprogname_linux.c +23 -0
- data/vendor/libressl/crypto/compat/getprogname_unimpl.c +7 -0
- data/vendor/libressl/crypto/compat/getprogname_windows.c +13 -0
- data/vendor/libressl/crypto/compat/posix_win.c +296 -0
- data/vendor/libressl/crypto/compat/syslog_r.c +19 -0
- data/vendor/libressl/crypto/compat/ui_openssl_win.c +334 -0
- data/vendor/libressl/dist.sh +22 -0
- data/vendor/libressl/gen-coverage-report.sh +58 -0
- data/vendor/libressl/gen-openbsd-tags.sh +20 -0
- data/vendor/libressl/include/CMakeLists.txt +61 -0
- data/vendor/libressl/include/Makefile.am +79 -0
- data/vendor/libressl/include/arch/loongarch64/opensslconf.h +150 -0
- data/vendor/libressl/include/arch/mips/opensslconf.h +150 -0
- data/vendor/libressl/include/compat/arpa/inet.h +15 -0
- data/vendor/libressl/include/compat/arpa/nameser.h +25 -0
- data/vendor/libressl/include/compat/cet.h +19 -0
- data/vendor/libressl/include/compat/dirent.h +17 -0
- data/vendor/libressl/include/compat/dirent_msvc.h +611 -0
- data/vendor/libressl/include/compat/endian.h +161 -0
- data/vendor/libressl/include/compat/err.h +95 -0
- data/vendor/libressl/include/compat/fcntl.h +32 -0
- data/vendor/libressl/include/compat/getopt.h +50 -0
- data/vendor/libressl/include/compat/limits.h +25 -0
- data/vendor/libressl/include/compat/netdb.h +10 -0
- data/vendor/libressl/include/compat/netinet/in.h +19 -0
- data/vendor/libressl/include/compat/netinet/ip.h +49 -0
- data/vendor/libressl/include/compat/netinet/tcp.h +10 -0
- data/vendor/libressl/include/compat/poll.h +63 -0
- data/vendor/libressl/include/compat/pthread.h +122 -0
- data/vendor/libressl/include/compat/readpassphrase.h +44 -0
- data/vendor/libressl/include/compat/resolv.h +24 -0
- data/vendor/libressl/include/compat/stdint.h +31 -0
- data/vendor/libressl/include/compat/stdio.h +65 -0
- data/vendor/libressl/include/compat/stdlib.h +57 -0
- data/vendor/libressl/include/compat/string.h +98 -0
- data/vendor/libressl/include/compat/sys/_null.h +18 -0
- data/vendor/libressl/include/compat/sys/ioctl.h +11 -0
- data/vendor/libressl/include/compat/sys/mman.h +19 -0
- data/vendor/libressl/include/compat/sys/param.h +15 -0
- data/vendor/libressl/include/compat/sys/queue.h +536 -0
- data/vendor/libressl/include/compat/sys/select.h +10 -0
- data/vendor/libressl/include/compat/sys/socket.h +18 -0
- data/vendor/libressl/include/compat/sys/stat.h +129 -0
- data/vendor/libressl/include/compat/sys/time.h +37 -0
- data/vendor/libressl/include/compat/sys/tree.h +1006 -0
- data/vendor/libressl/include/compat/sys/types.h +69 -0
- data/vendor/libressl/include/compat/sys/uio.h +17 -0
- data/vendor/libressl/include/compat/syslog.h +38 -0
- data/vendor/libressl/include/compat/time.h +59 -0
- data/vendor/libressl/include/compat/unistd.h +83 -0
- data/vendor/libressl/include/compat/win32netcompat.h +57 -0
- data/vendor/libressl/include/openssl/Makefile.am.tpl +45 -0
- data/vendor/libressl/libcrypto.pc.in +28 -0
- data/vendor/libressl/libressl.pub +2 -0
- data/vendor/libressl/libssl.pc.in +28 -0
- data/vendor/libressl/libtls.pc.in +28 -0
- data/vendor/libressl/m4/ax_add_fortify_source.m4 +80 -0
- data/vendor/libressl/m4/ax_check_compile_flag.m4 +53 -0
- data/vendor/libressl/m4/check-hardening-options.m4 +110 -0
- data/vendor/libressl/m4/check-libc.m4 +189 -0
- data/vendor/libressl/m4/check-os-options.m4 +181 -0
- data/vendor/libressl/m4/disable-compiler-warnings.m4 +44 -0
- data/vendor/libressl/man/CMakeLists.txt +26 -0
- data/vendor/libressl/man/links +2780 -0
- data/vendor/libressl/man/update_links.sh +25 -0
- data/vendor/libressl/openssl.pc.in +11 -0
- data/vendor/libressl/patches/bn_shift.patch +34 -0
- data/vendor/libressl/patches/crypto_arch.h.patch +34 -0
- data/vendor/libressl/patches/crypto_namespace.h.patch +22 -0
- data/vendor/libressl/patches/netcat.c.patch +178 -0
- data/vendor/libressl/patches/openssl.c.patch +12 -0
- data/vendor/libressl/patches/opensslfeatures.h.patch +49 -0
- data/vendor/libressl/patches/patch-amd64-crypto-cpu-caps.c.patch +20 -0
- data/vendor/libressl/patches/patch-i386-crypto-cpu-caps.c.patch +20 -0
- data/vendor/libressl/patches/speed.c.patch +114 -0
- data/vendor/libressl/patches/ssl_namespace.h.patch +21 -0
- data/vendor/libressl/patches/tls.h.patch +16 -0
- data/vendor/libressl/patches/tls_config.c.patch +15 -0
- data/vendor/libressl/patches/win32_amd64_bn_arch.h.patch +28 -0
- data/vendor/libressl/patches/windows_headers.patch +80 -0
- data/vendor/libressl/scripts/config.guess +1774 -0
- data/vendor/libressl/scripts/config.sub +1907 -0
- data/vendor/libressl/scripts/i686-w64-mingw32.cmake +9 -0
- data/vendor/libressl/scripts/test +210 -0
- data/vendor/libressl/scripts/wrap-compiler-for-flag-check +31 -0
- data/vendor/libressl/scripts/x86_64-w64-mingw32.cmake +9 -0
- data/vendor/libressl/ssl/CMakeLists.txt +183 -0
- data/vendor/libressl/ssl/Makefile.am +187 -0
- data/vendor/libressl/tests/CMakeLists.txt +970 -0
- data/vendor/libressl/tests/Makefile.am +944 -0
- data/vendor/libressl/tests/aeadtest.sh +30 -0
- data/vendor/libressl/tests/arc4randomforktest.sh +21 -0
- data/vendor/libressl/tests/asn1time_small.test +10 -0
- data/vendor/libressl/tests/cmake/CMakeLists.txt +52 -0
- data/vendor/libressl/tests/cmake/crypto.c +7 -0
- data/vendor/libressl/tests/cmake/ssl.c +6 -0
- data/vendor/libressl/tests/cmake/tls.c +6 -0
- data/vendor/libressl/tests/compat/pipe2.c +186 -0
- data/vendor/libressl/tests/dtlstest.sh +28 -0
- data/vendor/libressl/tests/evptest.sh +22 -0
- data/vendor/libressl/tests/keypairtest.sh +27 -0
- data/vendor/libressl/tests/mlkem_tests.sh +39 -0
- data/vendor/libressl/tests/ocsptest.bat +25 -0
- data/vendor/libressl/tests/ocsptest.sh +23 -0
- data/vendor/libressl/tests/openssl.cnf +29 -0
- data/vendor/libressl/tests/optionstest.c +381 -0
- data/vendor/libressl/tests/pidwraptest.c +85 -0
- data/vendor/libressl/tests/pidwraptest.sh +26 -0
- data/vendor/libressl/tests/quictest.bat +27 -0
- data/vendor/libressl/tests/quictest.sh +30 -0
- data/vendor/libressl/tests/renegotiation_test.bat +27 -0
- data/vendor/libressl/tests/renegotiation_test.sh +30 -0
- data/vendor/libressl/tests/rfc5280time_small.test +10 -0
- data/vendor/libressl/tests/servertest.bat +27 -0
- data/vendor/libressl/tests/servertest.sh +30 -0
- data/vendor/libressl/tests/shutdowntest.bat +27 -0
- data/vendor/libressl/tests/shutdowntest.sh +30 -0
- data/vendor/libressl/tests/ssltest.bat +32 -0
- data/vendor/libressl/tests/ssltest.sh +48 -0
- data/vendor/libressl/tests/testdsa.bat +47 -0
- data/vendor/libressl/tests/testdsa.sh +57 -0
- data/vendor/libressl/tests/testenc.bat +85 -0
- data/vendor/libressl/tests/testenc.sh +93 -0
- data/vendor/libressl/tests/testrsa.bat +47 -0
- data/vendor/libressl/tests/testrsa.sh +57 -0
- data/vendor/libressl/tests/testssl.bat +171 -0
- data/vendor/libressl/tests/tlstest.bat +27 -0
- data/vendor/libressl/tests/tlstest.sh +28 -0
- data/vendor/libressl/tls/CMakeLists.txt +125 -0
- data/vendor/libressl/tls/Makefile.am +76 -0
- data/vendor/libressl/tls/compat/ftruncate.c +17 -0
- data/vendor/libressl/tls/compat/pread.c +29 -0
- data/vendor/libressl/tls/compat/pwrite.c +29 -0
- data/vendor/libressl/update.sh +460 -0
- data/vendor/liburing/.github/workflows/ci.yml +8 -0
- data/vendor/liburing/configure +23 -2
- data/vendor/liburing/examples/helpers.c +1 -1
- data/vendor/liburing/examples/helpers.h +1 -1
- data/vendor/liburing/examples/reg-wait.c +3 -3
- data/vendor/liburing/examples/zcrx.c +5 -5
- data/vendor/liburing/liburing.spec +1 -1
- data/vendor/liburing/src/include/liburing/io_uring.h +16 -0
- data/vendor/liburing/src/include/liburing.h +20 -4
- data/vendor/liburing/src/lib.h +2 -4
- data/vendor/liburing/src/liburing-ffi.map +7 -0
- data/vendor/liburing/src/liburing.map +7 -0
- data/vendor/liburing/src/register.c +5 -0
- data/vendor/liburing/src/sanitize.c +5 -4
- data/vendor/liburing/src/setup.c +43 -28
- data/vendor/liburing/test/Makefile +7 -0
- data/vendor/liburing/test/cmd-discard.c +2 -2
- data/vendor/liburing/test/evfd-short-read.c +84 -0
- data/vendor/liburing/test/fdinfo-sqpoll.c +117 -0
- data/vendor/liburing/test/fdinfo.c +1 -1
- data/vendor/liburing/test/fixed-buf-merge.c +2 -2
- data/vendor/liburing/test/futex-kill.c +135 -0
- data/vendor/liburing/test/helpers.c +1 -1
- data/vendor/liburing/test/helpers.h +1 -1
- data/vendor/liburing/test/init-mem.c +50 -12
- data/vendor/liburing/test/io_uring_passthrough.c +25 -6
- data/vendor/liburing/test/msg-ring.c +123 -9
- data/vendor/liburing/test/recv-bundle-short-ooo.c +16 -1
- data/vendor/liburing/test/recv-inc-ooo.c +411 -0
- data/vendor/liburing/test/recv-mshot-fair.c +513 -0
- data/vendor/liburing/test/reg-wait.c +14 -14
- data/vendor/liburing/test/send-zerocopy.c +4 -4
- data/vendor/liburing/test/timerfd-short-read.c +81 -0
- data/vendor/liburing/test/timestamp.c +382 -0
- data/vendor/liburing/test/zcrx.c +22 -22
- metadata +222 -2
@@ -0,0 +1,46 @@
|
|
1
|
+
if !HAVE_ARC4RANDOM_BUF
|
2
|
+
libcompat_la_SOURCES += compat/arc4random.c
|
3
|
+
libcompat_la_SOURCES += compat/arc4random_uniform.c
|
4
|
+
|
5
|
+
if !HAVE_GETENTROPY
|
6
|
+
if HOST_AIX
|
7
|
+
libcompat_la_SOURCES += compat/getentropy_aix.c
|
8
|
+
endif
|
9
|
+
if HOST_FREEBSD
|
10
|
+
libcompat_la_SOURCES += compat/getentropy_freebsd.c
|
11
|
+
endif
|
12
|
+
if HOST_HPUX
|
13
|
+
libcompat_la_SOURCES += compat/getentropy_hpux.c
|
14
|
+
endif
|
15
|
+
if HOST_LINUX
|
16
|
+
libcompat_la_SOURCES += compat/getentropy_linux.c
|
17
|
+
endif
|
18
|
+
if HOST_NETBSD
|
19
|
+
libcompat_la_SOURCES += compat/getentropy_netbsd.c
|
20
|
+
endif
|
21
|
+
if HOST_DARWIN
|
22
|
+
libcompat_la_SOURCES += compat/getentropy_osx.c
|
23
|
+
endif
|
24
|
+
if HOST_SOLARIS
|
25
|
+
libcompat_la_SOURCES += compat/getentropy_solaris.c
|
26
|
+
endif
|
27
|
+
if HOST_WIN
|
28
|
+
libcompat_la_SOURCES += compat/getentropy_win.c
|
29
|
+
endif
|
30
|
+
endif
|
31
|
+
|
32
|
+
endif
|
33
|
+
|
34
|
+
noinst_HEADERS =
|
35
|
+
noinst_HEADERS += compat/arc4random.h
|
36
|
+
noinst_HEADERS += compat/arc4random_aix.h
|
37
|
+
noinst_HEADERS += compat/arc4random_freebsd.h
|
38
|
+
noinst_HEADERS += compat/arc4random_hpux.h
|
39
|
+
noinst_HEADERS += compat/arc4random_linux.h
|
40
|
+
noinst_HEADERS += compat/arc4random_netbsd.h
|
41
|
+
noinst_HEADERS += compat/arc4random_osx.h
|
42
|
+
noinst_HEADERS += compat/arc4random_solaris.h
|
43
|
+
noinst_HEADERS += compat/arc4random_win.h
|
44
|
+
noinst_HEADERS += compat/chacha_private.h
|
45
|
+
|
46
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
ASM_MIPS_ELF = aes/aes-mips.S
|
2
|
+
ASM_MIPS_ELF += bn/bn-mips.S
|
3
|
+
ASM_MIPS_ELF += bn/mont-mips.S
|
4
|
+
ASM_MIPS_ELF += sha/sha1-mips.S
|
5
|
+
ASM_MIPS_ELF += sha/sha512-mips.S
|
6
|
+
ASM_MIPS_ELF += sha/sha256-mips.S
|
7
|
+
|
8
|
+
EXTRA_DIST += $(ASM_MIPS_ELF)
|
9
|
+
|
10
|
+
if HOST_ASM_ELF_MIPS
|
11
|
+
libcrypto_la_CPPFLAGS += -DAES_ASM
|
12
|
+
libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT
|
13
|
+
libcrypto_la_SOURCES += $(ASM_MIPS_ELF)
|
14
|
+
endif
|
@@ -0,0 +1,14 @@
|
|
1
|
+
ASM_MIPS64_ELF = aes/aes-mips.S
|
2
|
+
ASM_MIPS64_ELF += bn/bn-mips.S
|
3
|
+
ASM_MIPS64_ELF += bn/mont-mips.S
|
4
|
+
ASM_MIPS64_ELF += sha/sha1-mips.S
|
5
|
+
ASM_MIPS64_ELF += sha/sha512-mips.S
|
6
|
+
ASM_MIPS64_ELF += sha/sha256-mips.S
|
7
|
+
|
8
|
+
EXTRA_DIST += $(ASM_MIPS64_ELF)
|
9
|
+
|
10
|
+
if HOST_ASM_ELF_MIPS64
|
11
|
+
libcrypto_la_CPPFLAGS += -DAES_ASM
|
12
|
+
libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT
|
13
|
+
libcrypto_la_SOURCES += $(ASM_MIPS64_ELF)
|
14
|
+
endif
|
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
ASM_X86_64_ELF = aes/aes-elf-x86_64.S
|
3
|
+
ASM_X86_64_ELF += aes/aesni-elf-x86_64.S
|
4
|
+
ASM_X86_64_ELF += bn/modexp512-elf-x86_64.S
|
5
|
+
ASM_X86_64_ELF += bn/mont-elf-x86_64.S
|
6
|
+
ASM_X86_64_ELF += bn/mont5-elf-x86_64.S
|
7
|
+
ASM_X86_64_ELF += modes/ghash-elf-x86_64.S
|
8
|
+
ASM_X86_64_ELF += rc4/rc4-elf-x86_64.S
|
9
|
+
|
10
|
+
ASM_X86_64_ELF += bn/arch/amd64/bignum_add.S
|
11
|
+
ASM_X86_64_ELF += bn/arch/amd64/bignum_cmadd.S
|
12
|
+
ASM_X86_64_ELF += bn/arch/amd64/bignum_cmul.S
|
13
|
+
ASM_X86_64_ELF += bn/arch/amd64/bignum_mul.S
|
14
|
+
ASM_X86_64_ELF += bn/arch/amd64/bignum_mul_4_8_alt.S
|
15
|
+
ASM_X86_64_ELF += bn/arch/amd64/bignum_mul_8_16_alt.S
|
16
|
+
ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr.S
|
17
|
+
ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr_4_8_alt.S
|
18
|
+
ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr_8_16_alt.S
|
19
|
+
ASM_X86_64_ELF += bn/arch/amd64/bignum_sub.S
|
20
|
+
ASM_X86_64_ELF += bn/arch/amd64/word_clz.S
|
21
|
+
ASM_X86_64_ELF += bn/arch/amd64/bn_arch.c
|
22
|
+
|
23
|
+
EXTRA_DIST += $(ASM_X86_64_ELF)
|
24
|
+
|
25
|
+
if HOST_ASM_ELF_X86_64
|
26
|
+
libcrypto_la_CPPFLAGS += -DAES_ASM
|
27
|
+
libcrypto_la_CPPFLAGS += -DBSAES_ASM
|
28
|
+
libcrypto_la_CPPFLAGS += -DVPAES_ASM
|
29
|
+
libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2
|
30
|
+
libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT
|
31
|
+
libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5
|
32
|
+
libcrypto_la_CPPFLAGS += -DGHASH_ASM
|
33
|
+
libcrypto_la_CPPFLAGS += -DRSA_ASM
|
34
|
+
libcrypto_la_SOURCES += $(ASM_X86_64_ELF)
|
35
|
+
endif
|
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
ASM_X86_64_MACOSX = aes/aes-macosx-x86_64.S
|
3
|
+
ASM_X86_64_MACOSX += aes/aesni-macosx-x86_64.S
|
4
|
+
ASM_X86_64_MACOSX += bn/modexp512-macosx-x86_64.S
|
5
|
+
ASM_X86_64_MACOSX += bn/mont-macosx-x86_64.S
|
6
|
+
ASM_X86_64_MACOSX += bn/mont5-macosx-x86_64.S
|
7
|
+
ASM_X86_64_MACOSX += modes/ghash-macosx-x86_64.S
|
8
|
+
ASM_X86_64_MACOSX += rc4/rc4-macosx-x86_64.S
|
9
|
+
|
10
|
+
ASM_X86_64_MACOSX += bn/arch/amd64/bignum_add.S
|
11
|
+
ASM_X86_64_MACOSX += bn/arch/amd64/bignum_cmadd.S
|
12
|
+
ASM_X86_64_MACOSX += bn/arch/amd64/bignum_cmul.S
|
13
|
+
ASM_X86_64_MACOSX += bn/arch/amd64/bignum_mul.S
|
14
|
+
ASM_X86_64_MACOSX += bn/arch/amd64/bignum_mul_4_8_alt.S
|
15
|
+
ASM_X86_64_MACOSX += bn/arch/amd64/bignum_mul_8_16_alt.S
|
16
|
+
ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr.S
|
17
|
+
ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr_4_8_alt.S
|
18
|
+
ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr_8_16_alt.S
|
19
|
+
ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sub.S
|
20
|
+
ASM_X86_64_MACOSX += bn/arch/amd64/word_clz.S
|
21
|
+
ASM_X86_64_MACOSX += bn/arch/amd64/bn_arch.c
|
22
|
+
|
23
|
+
EXTRA_DIST += $(ASM_X86_64_MACOSX)
|
24
|
+
|
25
|
+
if HOST_ASM_MACOSX_X86_64
|
26
|
+
libcrypto_la_CPPFLAGS += -DAES_ASM
|
27
|
+
libcrypto_la_CPPFLAGS += -DBSAES_ASM
|
28
|
+
libcrypto_la_CPPFLAGS += -DVPAES_ASM
|
29
|
+
libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2
|
30
|
+
libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT
|
31
|
+
libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5
|
32
|
+
libcrypto_la_CPPFLAGS += -DGHASH_ASM
|
33
|
+
libcrypto_la_CPPFLAGS += -DRSA_ASM
|
34
|
+
libcrypto_la_SOURCES += $(ASM_X86_64_MACOSX)
|
35
|
+
endif
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
ASM_X86_64_MASM = aes/aes-masm-x86_64.S
|
3
|
+
ASM_X86_64_MASM += aes/aesni-masm-x86_64.S
|
4
|
+
ASM_X86_64_MASM += bn/modexp512-masm-x86_64.S
|
5
|
+
ASM_X86_64_MASM += bn/mont-masm-x86_64.S
|
6
|
+
ASM_X86_64_MASM += bn/mont5-masm-x86_64.S
|
7
|
+
ASM_X86_64_MASM += modes/ghash-masm-x86_64.S
|
8
|
+
ASM_X86_64_MASM += rc4/rc4-masm-x86_64.S
|
9
|
+
|
10
|
+
EXTRA_DIST += $(ASM_X86_64_MASM)
|
11
|
+
|
12
|
+
if HOST_ASM_MASM_X86_64
|
13
|
+
libcrypto_la_CPPFLAGS += -DAES_ASM
|
14
|
+
libcrypto_la_CPPFLAGS += -DBSAES_ASM
|
15
|
+
libcrypto_la_CPPFLAGS += -DVPAES_ASM
|
16
|
+
libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2
|
17
|
+
libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT
|
18
|
+
libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5
|
19
|
+
libcrypto_la_CPPFLAGS += -DGHASH_ASM
|
20
|
+
libcrypto_la_CPPFLAGS += -DRSA_ASM
|
21
|
+
libcrypto_la_SOURCES += $(ASM_X86_64_MASM)
|
22
|
+
endif
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
ASM_X86_64_MINGW64 = aes/aes-mingw64-x86_64.S
|
3
|
+
ASM_X86_64_MINGW64 += aes/aesni-mingw64-x86_64.S
|
4
|
+
#ASM_X86_64_MINGW64 += bn/modexp512-mingw64-x86_64.S
|
5
|
+
#ASM_X86_64_MINGW64 += bn/mont-mingw64-x86_64.S
|
6
|
+
#ASM_X86_64_MINGW64 += bn/mont5-mingw64-x86_64.S
|
7
|
+
ASM_X86_64_MINGW64 += modes/ghash-mingw64-x86_64.S
|
8
|
+
ASM_X86_64_MINGW64 += rc4/rc4-mingw64-x86_64.S
|
9
|
+
|
10
|
+
EXTRA_DIST += $(ASM_X86_64_MINGW64)
|
11
|
+
|
12
|
+
if HOST_ASM_MINGW64_X86_64
|
13
|
+
libcrypto_la_CPPFLAGS += -Dendbr32=endbr64
|
14
|
+
libcrypto_la_CPPFLAGS += -DAES_ASM
|
15
|
+
libcrypto_la_CPPFLAGS += -DBSAES_ASM
|
16
|
+
libcrypto_la_CPPFLAGS += -DVPAES_ASM
|
17
|
+
libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2
|
18
|
+
#libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT
|
19
|
+
#libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5
|
20
|
+
libcrypto_la_CPPFLAGS += -DGHASH_ASM
|
21
|
+
libcrypto_la_CPPFLAGS += -DRSA_ASM
|
22
|
+
libcrypto_la_SOURCES += $(ASM_X86_64_MINGW64)
|
23
|
+
endif
|
@@ -0,0 +1,60 @@
|
|
1
|
+
/* $OpenBSD: crypto_cpu_caps.c,v 1.2 2024/11/12 13:52:31 jsing Exp $ */
|
2
|
+
/*
|
3
|
+
* Copyright (c) 2025 Brent Cook <bcook@openbsd.org>
|
4
|
+
*
|
5
|
+
* Permission to use, copy, modify, and distribute this software for any
|
6
|
+
* purpose with or without fee is hereby granted, provided that the above
|
7
|
+
* copyright notice and this permission notice appear in all copies.
|
8
|
+
*
|
9
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
10
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
11
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
12
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
15
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#include <sys/sysctl.h>
|
19
|
+
|
20
|
+
#include "crypto_arch.h"
|
21
|
+
|
22
|
+
/* Machine dependent CPU capabilities. */
|
23
|
+
uint64_t crypto_cpu_caps_aarch64;
|
24
|
+
|
25
|
+
static uint64_t
|
26
|
+
check_cpu_cap(const char *cap_name, uint64_t cap_flag)
|
27
|
+
{
|
28
|
+
int has_cap = 0;
|
29
|
+
size_t len = sizeof(has_cap);
|
30
|
+
|
31
|
+
sysctlbyname(cap_name, &has_cap, &len, NULL, 0);
|
32
|
+
|
33
|
+
return has_cap ? cap_flag : 0;
|
34
|
+
}
|
35
|
+
|
36
|
+
void
|
37
|
+
crypto_cpu_caps_init(void)
|
38
|
+
{
|
39
|
+
crypto_cpu_caps_aarch64 = 0;
|
40
|
+
|
41
|
+
/* from https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics#3918855 */
|
42
|
+
|
43
|
+
crypto_cpu_caps_aarch64 |= check_cpu_cap("hw.optional.arm.FEAT_AES",
|
44
|
+
CRYPTO_CPU_CAPS_AARCH64_AES);
|
45
|
+
|
46
|
+
crypto_cpu_caps_aarch64 |= check_cpu_cap("hw.optional.arm.FEAT_PMULL",
|
47
|
+
CRYPTO_CPU_CAPS_AARCH64_PMULL);
|
48
|
+
|
49
|
+
crypto_cpu_caps_aarch64 |= check_cpu_cap("hw.optional.arm.FEAT_SHA1",
|
50
|
+
CRYPTO_CPU_CAPS_AARCH64_SHA1);
|
51
|
+
|
52
|
+
crypto_cpu_caps_aarch64 |= check_cpu_cap("hw.optional.arm.FEAT_SHA256",
|
53
|
+
CRYPTO_CPU_CAPS_AARCH64_SHA2);
|
54
|
+
|
55
|
+
crypto_cpu_caps_aarch64 |= check_cpu_cap("hw.optional.arm.FEAT_SHA512",
|
56
|
+
CRYPTO_CPU_CAPS_AARCH64_SHA512);
|
57
|
+
|
58
|
+
crypto_cpu_caps_aarch64 |= check_cpu_cap("hw.optional.arm.FEAT_SHA3",
|
59
|
+
CRYPTO_CPU_CAPS_AARCH64_SHA3);
|
60
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
/* $OpenBSD: crypto_cpu_caps.c,v 1.2 2024/11/12 13:52:31 jsing Exp $ */
|
2
|
+
/*
|
3
|
+
* Copyright (c) 2025 Brent Cook <bcook@openbsd.org>
|
4
|
+
*
|
5
|
+
* Permission to use, copy, modify, and distribute this software for any
|
6
|
+
* purpose with or without fee is hereby granted, provided that the above
|
7
|
+
* copyright notice and this permission notice appear in all copies.
|
8
|
+
*
|
9
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
10
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
11
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
12
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
15
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#include <sys/auxv.h>
|
19
|
+
|
20
|
+
/* from arch/arm64/include/uapi/asm/hwcap.h */
|
21
|
+
#define HWCAP_AES (1 << 3)
|
22
|
+
#define HWCAP_PMULL (1 << 4)
|
23
|
+
#define HWCAP_SHA1 (1 << 5)
|
24
|
+
#define HWCAP_SHA2 (1 << 6)
|
25
|
+
#define HWCAP_CRC32 (1 << 7)
|
26
|
+
#define HWCAP_SHA3 (1 << 17)
|
27
|
+
#define HWCAP_SHA512 (1 << 21)
|
28
|
+
|
29
|
+
#include "crypto_arch.h"
|
30
|
+
|
31
|
+
/* Machine dependent CPU capabilities. */
|
32
|
+
uint64_t crypto_cpu_caps_aarch64;
|
33
|
+
|
34
|
+
static uint64_t
|
35
|
+
check_cpu_cap(unsigned long hwcap, uint64_t cap_flag)
|
36
|
+
{
|
37
|
+
return (getauxval(AT_HWCAP) & hwcap) ? cap_flag : 0;
|
38
|
+
}
|
39
|
+
|
40
|
+
void
|
41
|
+
crypto_cpu_caps_init(void)
|
42
|
+
{
|
43
|
+
crypto_cpu_caps_aarch64 = 0;
|
44
|
+
|
45
|
+
crypto_cpu_caps_aarch64 |= check_cpu_cap(HWCAP_AES,
|
46
|
+
CRYPTO_CPU_CAPS_AARCH64_AES);
|
47
|
+
|
48
|
+
crypto_cpu_caps_aarch64 |= check_cpu_cap(HWCAP_PMULL,
|
49
|
+
CRYPTO_CPU_CAPS_AARCH64_PMULL);
|
50
|
+
|
51
|
+
crypto_cpu_caps_aarch64 |= check_cpu_cap(HWCAP_SHA1,
|
52
|
+
CRYPTO_CPU_CAPS_AARCH64_SHA1);
|
53
|
+
|
54
|
+
crypto_cpu_caps_aarch64 |= check_cpu_cap(HWCAP_SHA2,
|
55
|
+
CRYPTO_CPU_CAPS_AARCH64_SHA2);
|
56
|
+
|
57
|
+
crypto_cpu_caps_aarch64 |= check_cpu_cap(HWCAP_SHA512,
|
58
|
+
CRYPTO_CPU_CAPS_AARCH64_SHA512);
|
59
|
+
|
60
|
+
crypto_cpu_caps_aarch64 |= check_cpu_cap(HWCAP_SHA3,
|
61
|
+
CRYPTO_CPU_CAPS_AARCH64_SHA3);
|
62
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2025 Brent Cook <bcook@openbsd.org>
|
3
|
+
*
|
4
|
+
* Permission to use, copy, modify, and distribute this software for any
|
5
|
+
* purpose with or without fee is hereby granted, provided that the above
|
6
|
+
* copyright notice and this permission notice appear in all copies.
|
7
|
+
*
|
8
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
9
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
10
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
11
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
12
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
13
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
14
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
15
|
+
*/
|
16
|
+
|
17
|
+
#include "crypto_arch.h"
|
18
|
+
|
19
|
+
/* Machine dependent CPU capabilities. */
|
20
|
+
uint64_t crypto_cpu_caps_aarch64;
|
21
|
+
|
22
|
+
void
|
23
|
+
crypto_cpu_caps_init(void)
|
24
|
+
{
|
25
|
+
crypto_cpu_caps_aarch64 = 0;
|
26
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
/* $OpenBSD: crypto_cpu_caps.c,v 1.2 2024/11/12 13:52:31 jsing Exp $ */
|
2
|
+
/*
|
3
|
+
* Copyright (c) 2025 Brent Cook <bcook@openbsd.org>
|
4
|
+
*
|
5
|
+
* Permission to use, copy, modify, and distribute this software for any
|
6
|
+
* purpose with or without fee is hereby granted, provided that the above
|
7
|
+
* copyright notice and this permission notice appear in all copies.
|
8
|
+
*
|
9
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
10
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
11
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
12
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
15
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#include <windows.h>
|
19
|
+
|
20
|
+
#include "crypto_arch.h"
|
21
|
+
|
22
|
+
/* Machine dependent CPU capabilities. */
|
23
|
+
uint64_t crypto_cpu_caps_aarch64;
|
24
|
+
|
25
|
+
void
|
26
|
+
crypto_cpu_caps_init(void)
|
27
|
+
{
|
28
|
+
crypto_cpu_caps_aarch64 = 0;
|
29
|
+
|
30
|
+
if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)) {
|
31
|
+
crypto_cpu_caps_aarch64 |= CRYPTO_CPU_CAPS_AARCH64_AES;
|
32
|
+
crypto_cpu_caps_aarch64 |= CRYPTO_CPU_CAPS_AARCH64_PMULL;
|
33
|
+
crypto_cpu_caps_aarch64 |= CRYPTO_CPU_CAPS_AARCH64_SHA1;
|
34
|
+
crypto_cpu_caps_aarch64 |= CRYPTO_CPU_CAPS_AARCH64_SHA2;
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */
|
2
|
+
/*
|
3
|
+
* Copyright (c) 2024 Joel Sing <jsing@openbsd.org>
|
4
|
+
*
|
5
|
+
* Permission to use, copy, modify, and distribute this software for any
|
6
|
+
* purpose with or without fee is hereby granted, provided that the above
|
7
|
+
* copyright notice and this permission notice appear in all copies.
|
8
|
+
*
|
9
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
10
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
11
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
12
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
15
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#ifndef HEADER_CRYPTO_ARCH_H
|
19
|
+
#define HEADER_CRYPTO_ARCH_H
|
20
|
+
|
21
|
+
#endif
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/* $OpenBSD$ */
|
2
|
+
/*
|
3
|
+
* Copyright (c) 2024 Joel Sing <jsing@openbsd.org>
|
4
|
+
*
|
5
|
+
* Permission to use, copy, modify, and distribute this software for any
|
6
|
+
* purpose with or without fee is hereby granted, provided that the above
|
7
|
+
* copyright notice and this permission notice appear in all copies.
|
8
|
+
*
|
9
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
10
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
11
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
12
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
15
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#ifndef HEADER_CRYPTO_ARCH_H
|
19
|
+
#define HEADER_CRYPTO_ARCH_H
|
20
|
+
|
21
|
+
#endif
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/* $OpenBSD: bn_arch.h,v 1.7 2023/07/09 10:37:32 jsing Exp $ */
|
2
|
+
/*
|
3
|
+
* Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
|
4
|
+
*
|
5
|
+
* Permission to use, copy, modify, and distribute this software for any
|
6
|
+
* purpose with or without fee is hereby granted, provided that the above
|
7
|
+
* copyright notice and this permission notice appear in all copies.
|
8
|
+
*
|
9
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
10
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
11
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
12
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
15
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#include <openssl/bn.h>
|
19
|
+
|
20
|
+
#ifndef HEADER_BN_ARCH_H
|
21
|
+
#define HEADER_BN_ARCH_H
|
22
|
+
|
23
|
+
#endif
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/* $OpenBSD: bn_arch.h,v 1.1 2023/01/20 10:04:34 jsing Exp $ */
|
2
|
+
/*
|
3
|
+
* Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
|
4
|
+
*
|
5
|
+
* Permission to use, copy, modify, and distribute this software for any
|
6
|
+
* purpose with or without fee is hereby granted, provided that the above
|
7
|
+
* copyright notice and this permission notice appear in all copies.
|
8
|
+
*
|
9
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
10
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
11
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
12
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
15
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#ifndef HEADER_BN_ARCH_H
|
19
|
+
#define HEADER_BN_ARCH_H
|
20
|
+
|
21
|
+
#ifndef OPENSSL_NO_ASM
|
22
|
+
|
23
|
+
#endif
|
24
|
+
#endif
|
@@ -0,0 +1,31 @@
|
|
1
|
+
arc4random.c
|
2
|
+
arc4random_aix.h
|
3
|
+
arc4random_freebsd.h
|
4
|
+
arc4random_hpux.h
|
5
|
+
arc4random_linux.h
|
6
|
+
arc4random_netbsd.h
|
7
|
+
arc4random_osx.h
|
8
|
+
arc4random_solaris.h
|
9
|
+
arc4random_uniform.c
|
10
|
+
arc4random_win.h
|
11
|
+
chacha_private.h
|
12
|
+
explicit_bzero.c
|
13
|
+
getentropy_aix.c
|
14
|
+
getentropy_freebsd.c
|
15
|
+
getentropy_hpux.c
|
16
|
+
getentropy_linux.c
|
17
|
+
getentropy_netbsd.c
|
18
|
+
getentropy_osx.c
|
19
|
+
getentropy_solaris.c
|
20
|
+
getentropy_win.c
|
21
|
+
reallocarray.c
|
22
|
+
recallocarray.c
|
23
|
+
strcasecmp.c
|
24
|
+
strlcat.c
|
25
|
+
strlcpy.c
|
26
|
+
strndup.c
|
27
|
+
strnlen.c
|
28
|
+
strsep.c
|
29
|
+
strtonum.c
|
30
|
+
timingsafe_bcmp.c
|
31
|
+
timingsafe_memcmp.c
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#ifndef LIBCRYPTOCOMPAT_ARC4RANDOM_H
|
2
|
+
#define LIBCRYPTOCOMPAT_ARC4RANDOM_H
|
3
|
+
|
4
|
+
#include <sys/param.h>
|
5
|
+
|
6
|
+
#if defined(_AIX)
|
7
|
+
#include "arc4random_aix.h"
|
8
|
+
|
9
|
+
#elif defined(__FreeBSD__)
|
10
|
+
#include "arc4random_freebsd.h"
|
11
|
+
|
12
|
+
#elif defined(__hpux)
|
13
|
+
#include "arc4random_hpux.h"
|
14
|
+
|
15
|
+
#elif defined(__linux__)
|
16
|
+
#include "arc4random_linux.h"
|
17
|
+
|
18
|
+
#elif defined(__midipix__)
|
19
|
+
#include "arc4random_linux.h"
|
20
|
+
|
21
|
+
#elif defined(__NetBSD__)
|
22
|
+
#include "arc4random_netbsd.h"
|
23
|
+
|
24
|
+
#elif defined(__APPLE__)
|
25
|
+
#include "arc4random_osx.h"
|
26
|
+
|
27
|
+
#elif defined(__sun)
|
28
|
+
#include "arc4random_solaris.h"
|
29
|
+
|
30
|
+
#elif defined(_WIN32)
|
31
|
+
#include "arc4random_win.h"
|
32
|
+
|
33
|
+
#elif defined(__EMSCRIPTEN__)
|
34
|
+
#include "arc4random_linux.h"
|
35
|
+
|
36
|
+
#else
|
37
|
+
#error "No arc4random hooks defined for this platform."
|
38
|
+
|
39
|
+
#endif
|
40
|
+
|
41
|
+
#endif
|
@@ -0,0 +1,55 @@
|
|
1
|
+
/*
|
2
|
+
* Public domain
|
3
|
+
*
|
4
|
+
* Dongsheng Song <dongsheng.song@gmail.com>
|
5
|
+
* Brent Cook <bcook@openbsd.org>
|
6
|
+
*/
|
7
|
+
|
8
|
+
#include <ws2tcpip.h>
|
9
|
+
|
10
|
+
#include <openssl/bio.h>
|
11
|
+
|
12
|
+
#include "err_local.h"
|
13
|
+
|
14
|
+
int
|
15
|
+
BIO_sock_init(void)
|
16
|
+
{
|
17
|
+
/*
|
18
|
+
* WSAStartup loads the winsock .dll and initializes the networking
|
19
|
+
* stack on Windows, or simply increases the reference count.
|
20
|
+
*/
|
21
|
+
static struct WSAData wsa_state = {0};
|
22
|
+
WORD version_requested = MAKEWORD(2, 2);
|
23
|
+
static int wsa_init_done = 0;
|
24
|
+
if (!wsa_init_done) {
|
25
|
+
if (WSAStartup(version_requested, &wsa_state) != 0) {
|
26
|
+
int err = WSAGetLastError();
|
27
|
+
SYSerror(err);
|
28
|
+
BIOerror(BIO_R_WSASTARTUP);
|
29
|
+
return (-1);
|
30
|
+
}
|
31
|
+
wsa_init_done = 1;
|
32
|
+
}
|
33
|
+
return (1);
|
34
|
+
}
|
35
|
+
|
36
|
+
void
|
37
|
+
BIO_sock_cleanup(void)
|
38
|
+
{
|
39
|
+
/*
|
40
|
+
* We could call WSACleanup here, but it is easy to get it wrong. Since
|
41
|
+
* this API provides no way to even tell if it failed, there is no safe
|
42
|
+
* way to expose that functionality here.
|
43
|
+
*
|
44
|
+
* The cost of leaving the networking DLLs loaded may have been large
|
45
|
+
* during the Windows 3.1/win32s era, but it is small in modern
|
46
|
+
* contexts, so don't bother.
|
47
|
+
*/
|
48
|
+
}
|
49
|
+
|
50
|
+
int
|
51
|
+
BIO_socket_nbio(int s, int mode)
|
52
|
+
{
|
53
|
+
u_long value = mode;
|
54
|
+
return ioctlsocket(s, FIONBIO, &value) != SOCKET_ERROR;
|
55
|
+
}
|