@annadata/capacitor-mqtt-quic 0.1.6 → 0.1.7
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.
- package/AnnadataCapacitorMqttQuic.podspec +2 -1
- package/README.md +121 -12
- package/android/NGTCP2_BUILD_INSTRUCTIONS.md +65 -44
- package/android/build-openssl.sh +1 -1
- package/android/install/nghttp3-android/arm64-v8a/include/nghttp3/nghttp3.h +3295 -0
- package/android/install/nghttp3-android/arm64-v8a/include/nghttp3/version.h +46 -0
- package/android/install/nghttp3-android/arm64-v8a/lib/cmake/nghttp3/nghttp3Config.cmake +3 -0
- package/android/install/nghttp3-android/arm64-v8a/lib/cmake/nghttp3/nghttp3ConfigVersion.cmake +65 -0
- package/android/install/nghttp3-android/arm64-v8a/lib/cmake/nghttp3/nghttp3Targets-release.cmake +29 -0
- package/android/install/nghttp3-android/arm64-v8a/lib/cmake/nghttp3/nghttp3Targets.cmake +114 -0
- package/android/install/nghttp3-android/arm64-v8a/lib/libnghttp3.a +0 -0
- package/android/install/nghttp3-android/arm64-v8a/lib/libnghttp3.so +0 -0
- package/android/install/nghttp3-android/arm64-v8a/lib/pkgconfig/libnghttp3.pc +34 -0
- package/android/install/nghttp3-android/arm64-v8a/share/doc/nghttp3/README.rst +75 -0
- package/android/install/nghttp3-android/armeabi-v7a/include/nghttp3/nghttp3.h +3295 -0
- package/android/install/nghttp3-android/armeabi-v7a/include/nghttp3/version.h +46 -0
- package/android/install/nghttp3-android/armeabi-v7a/lib/cmake/nghttp3/nghttp3Config.cmake +3 -0
- package/android/install/nghttp3-android/armeabi-v7a/lib/cmake/nghttp3/nghttp3ConfigVersion.cmake +65 -0
- package/android/install/nghttp3-android/armeabi-v7a/lib/cmake/nghttp3/nghttp3Targets-release.cmake +29 -0
- package/android/install/nghttp3-android/armeabi-v7a/lib/cmake/nghttp3/nghttp3Targets.cmake +114 -0
- package/android/install/nghttp3-android/armeabi-v7a/lib/libnghttp3.a +0 -0
- package/android/install/nghttp3-android/armeabi-v7a/lib/libnghttp3.so +0 -0
- package/android/install/nghttp3-android/armeabi-v7a/lib/pkgconfig/libnghttp3.pc +34 -0
- package/android/install/nghttp3-android/armeabi-v7a/share/doc/nghttp3/README.rst +75 -0
- package/android/install/nghttp3-android/x86_64/include/nghttp3/nghttp3.h +3295 -0
- package/android/install/nghttp3-android/x86_64/include/nghttp3/version.h +46 -0
- package/android/install/nghttp3-android/x86_64/lib/cmake/nghttp3/nghttp3Config.cmake +3 -0
- package/android/install/nghttp3-android/x86_64/lib/cmake/nghttp3/nghttp3ConfigVersion.cmake +65 -0
- package/android/install/nghttp3-android/x86_64/lib/cmake/nghttp3/nghttp3Targets-release.cmake +29 -0
- package/android/install/nghttp3-android/x86_64/lib/cmake/nghttp3/nghttp3Targets.cmake +114 -0
- package/android/install/nghttp3-android/x86_64/lib/libnghttp3.a +0 -0
- package/android/install/nghttp3-android/x86_64/lib/libnghttp3.so +0 -0
- package/android/install/nghttp3-android/x86_64/lib/pkgconfig/libnghttp3.pc +34 -0
- package/android/install/nghttp3-android/x86_64/share/doc/nghttp3/README.rst +75 -0
- package/android/install/ngtcp2-android/arm64-v8a/include/ngtcp2/ngtcp2.h +6254 -0
- package/android/install/ngtcp2-android/arm64-v8a/include/ngtcp2/ngtcp2_crypto.h +1037 -0
- package/android/install/ngtcp2-android/arm64-v8a/include/ngtcp2/ngtcp2_crypto_wolfssl.h +106 -0
- package/android/install/ngtcp2-android/arm64-v8a/include/ngtcp2/version.h +51 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/cmake/ngtcp2/ngtcp2Config.cmake +6 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/cmake/ngtcp2/ngtcp2ConfigVersion.cmake +65 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/cmake/ngtcp2/ngtcp2Targets-release.cmake +29 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/cmake/ngtcp2/ngtcp2Targets.cmake +114 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2.a +0 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2.so +0 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2_crypto_wolfssl.a +0 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/libngtcp2_crypto_wolfssl.so +0 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/pkgconfig/libngtcp2.pc +33 -0
- package/android/install/ngtcp2-android/arm64-v8a/lib/pkgconfig/libngtcp2_crypto_wolfssl.pc +34 -0
- package/android/install/ngtcp2-android/arm64-v8a/share/doc/ngtcp2/README.rst +385 -0
- package/android/install/ngtcp2-android/armeabi-v7a/include/ngtcp2/ngtcp2.h +6254 -0
- package/android/install/ngtcp2-android/armeabi-v7a/include/ngtcp2/ngtcp2_crypto.h +1037 -0
- package/android/install/ngtcp2-android/armeabi-v7a/include/ngtcp2/ngtcp2_crypto_wolfssl.h +106 -0
- package/android/install/ngtcp2-android/armeabi-v7a/include/ngtcp2/version.h +51 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/cmake/ngtcp2/ngtcp2Config.cmake +6 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/cmake/ngtcp2/ngtcp2ConfigVersion.cmake +65 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/cmake/ngtcp2/ngtcp2Targets-release.cmake +29 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/cmake/ngtcp2/ngtcp2Targets.cmake +114 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2.a +0 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2.so +0 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2_crypto_wolfssl.a +0 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/libngtcp2_crypto_wolfssl.so +0 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/pkgconfig/libngtcp2.pc +33 -0
- package/android/install/ngtcp2-android/armeabi-v7a/lib/pkgconfig/libngtcp2_crypto_wolfssl.pc +34 -0
- package/android/install/ngtcp2-android/armeabi-v7a/share/doc/ngtcp2/README.rst +385 -0
- package/android/install/ngtcp2-android/x86_64/include/ngtcp2/ngtcp2.h +6254 -0
- package/android/install/ngtcp2-android/x86_64/include/ngtcp2/ngtcp2_crypto.h +1037 -0
- package/android/install/ngtcp2-android/x86_64/include/ngtcp2/ngtcp2_crypto_wolfssl.h +106 -0
- package/android/install/ngtcp2-android/x86_64/include/ngtcp2/version.h +51 -0
- package/android/install/ngtcp2-android/x86_64/lib/cmake/ngtcp2/ngtcp2Config.cmake +6 -0
- package/android/install/ngtcp2-android/x86_64/lib/cmake/ngtcp2/ngtcp2ConfigVersion.cmake +65 -0
- package/android/install/ngtcp2-android/x86_64/lib/cmake/ngtcp2/ngtcp2Targets-release.cmake +29 -0
- package/android/install/ngtcp2-android/x86_64/lib/cmake/ngtcp2/ngtcp2Targets.cmake +114 -0
- package/android/install/ngtcp2-android/x86_64/lib/libngtcp2.a +0 -0
- package/android/install/ngtcp2-android/x86_64/lib/libngtcp2.so +0 -0
- package/android/install/ngtcp2-android/x86_64/lib/libngtcp2_crypto_wolfssl.a +0 -0
- package/android/install/ngtcp2-android/x86_64/lib/libngtcp2_crypto_wolfssl.so +0 -0
- package/android/install/ngtcp2-android/x86_64/lib/pkgconfig/libngtcp2.pc +33 -0
- package/android/install/ngtcp2-android/x86_64/lib/pkgconfig/libngtcp2_crypto_wolfssl.pc +34 -0
- package/android/install/ngtcp2-android/x86_64/share/doc/ngtcp2/README.rst +385 -0
- package/android/install/wolfssl-android/arm64-v8a/bin/wolfssl-config +117 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/callbacks.h +93 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/certs_test.h +7073 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/certs_test_sm.h +2913 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/crl.h +58 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/error-ssl.h +280 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/ocsp.h +191 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/aes.h +117 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/asn1.h +315 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/asn1t.h +30 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/bio.h +237 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/bn.h +332 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/buffer.h +57 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/camellia.h +27 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/cmac.h +66 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/cms.h +26 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/compat_types.h +70 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/conf.h +117 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/crypto.h +171 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/des.h +124 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/dh.h +144 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/dsa.h +164 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ec.h +525 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ec25519.h +46 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ec448.h +46 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ecdh.h +49 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ecdsa.h +87 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ed25519.h +49 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ed448.h +49 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/engine.h +9 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/err.h +84 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/evp.h +1540 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/fips_rand.h +125 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/hmac.h +98 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/kdf.h +45 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/lhash.h +64 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/md4.h +66 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/md5.h +108 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/modes.h +45 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/obj_mac.h +92 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/objects.h +86 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ocsp.h +108 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/opensslconf.h +8 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/opensslv.h +78 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ossl_typ.h +32 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/pem.h +301 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/pkcs12.h +57 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/pkcs7.h +110 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/rand.h +38 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/rc4.h +64 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ripemd.h +58 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/rsa.h +291 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/safestack.h +40 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/sha.h +331 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/sha3.h +158 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/srp.h +33 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ssl.h +1923 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ssl23.h +1 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/stack.h +61 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/tls1.h +64 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/txt_db.h +60 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/ui.h +2 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/x509.h +227 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/x509_vfy.h +50 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/openssl/x509v3.h +237 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/options.h +273 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/quic.h +310 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/sniffer.h +359 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/sniffer_error.h +151 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/ssl.h +6300 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/test.h +4989 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/version.h +40 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/aes.h +1074 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/arc4.h +69 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ascon.h +109 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/asn.h +2855 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/asn_public.h +1009 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/blake2-impl.h +155 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/blake2-int.h +174 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/blake2.h +108 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/camellia.h +116 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/chacha.h +133 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/chacha20_poly1305.h +157 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/cmac.h +168 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/coding.h +107 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/compress.h +60 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/cpuid.h +153 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/cryptocb.h +770 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/curve25519.h +225 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/curve448.h +151 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/des3.h +167 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/dh.h +210 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/dilithium.h +1051 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/dsa.h +121 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ecc.h +1074 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/eccsi.h +176 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ed25519.h +239 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ed448.h +214 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/error-crypt.h +368 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ext_lms.h +62 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ext_mlkem.h +74 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ext_xmss.h +53 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/falcon.h +180 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/fe_448.h +122 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/fe_operations.h +189 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/fips_test.h +131 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ge_448.h +84 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ge_operations.h +134 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/hash.h +296 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/hmac.h +231 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/hpke.h +145 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/integer.h +449 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/kdf.h +199 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/lms.h +202 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/logging.h +588 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/md2.h +83 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/md4.h +77 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/md5.h +141 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/mem_track.h +968 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/memory.h +545 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/misc.h +214 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/mlkem.h +377 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/mpi_class.h +1021 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/mpi_superclass.h +96 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/oid_sum.h +1907 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/pkcs12.h +79 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/pkcs7.h +578 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/poly1305.h +207 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/pwdbased.h +81 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/random.h +300 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/rc2.h +68 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/ripemd.h +67 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/rsa.h +494 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sakke.h +228 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/settings.h +4762 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sha.h +237 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sha256.h +360 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sha3.h +274 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sha512.h +372 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/signature.h +87 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/siphash.h +101 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sm2.h +27 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sm3.h +27 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sm4.h +27 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sp_int.h +1396 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/sphincs.h +167 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/srp.h +313 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/tfm.h +941 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/types.h +2383 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/visibility.h +97 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_encrypt.h +126 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_lms.h +506 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_mlkem.h +370 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_port.h +1764 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wc_xmss.h +285 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wolfevent.h +120 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/wolfmath.h +175 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfcrypt/xmss.h +203 -0
- package/android/install/wolfssl-android/arm64-v8a/include/wolfssl/wolfio.h +1035 -0
- package/android/install/wolfssl-android/arm64-v8a/lib/libwolfssl.a +0 -0
- package/android/install/wolfssl-android/arm64-v8a/lib/libwolfssl.la +41 -0
- package/android/install/wolfssl-android/arm64-v8a/lib/pkgconfig/wolfssl.pc +11 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/QUIC.md +117 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/README.txt +8 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/async_client.c +245 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/async_server.c +331 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/client.c +4885 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/echoclient.c +341 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/echoserver.c +498 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/sctp-client-dtls.c +135 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/sctp-client.c +78 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/sctp-server-dtls.c +134 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/sctp-server.c +83 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/server.c +4124 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/example/tls_bench.c +2357 -0
- package/android/install/wolfssl-android/arm64-v8a/share/doc/wolfssl/taoCert.txt +176 -0
- package/android/install/wolfssl-android/armeabi-v7a/bin/wolfssl-config +117 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/callbacks.h +93 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/certs_test.h +7073 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/certs_test_sm.h +2913 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/crl.h +58 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/error-ssl.h +280 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/ocsp.h +191 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/aes.h +117 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/asn1.h +315 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/asn1t.h +30 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/bio.h +237 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/bn.h +332 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/buffer.h +57 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/camellia.h +27 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/cmac.h +66 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/cms.h +26 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/compat_types.h +70 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/conf.h +117 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/crypto.h +171 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/des.h +124 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/dh.h +144 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/dsa.h +164 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ec.h +525 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ec25519.h +46 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ec448.h +46 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ecdh.h +49 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ecdsa.h +87 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ed25519.h +49 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ed448.h +49 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/engine.h +9 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/err.h +84 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/evp.h +1540 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/fips_rand.h +125 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/hmac.h +98 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/kdf.h +45 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/lhash.h +64 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/md4.h +66 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/md5.h +108 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/modes.h +45 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/obj_mac.h +92 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/objects.h +86 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ocsp.h +108 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/opensslconf.h +8 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/opensslv.h +78 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ossl_typ.h +32 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/pem.h +301 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/pkcs12.h +57 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/pkcs7.h +110 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/rand.h +38 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/rc4.h +64 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ripemd.h +58 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/rsa.h +291 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/safestack.h +40 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/sha.h +331 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/sha3.h +158 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/srp.h +33 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ssl.h +1923 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ssl23.h +1 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/stack.h +61 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/tls1.h +64 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/txt_db.h +60 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/ui.h +2 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/x509.h +227 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/x509_vfy.h +50 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/openssl/x509v3.h +237 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/options.h +261 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/quic.h +310 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/sniffer.h +359 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/sniffer_error.h +151 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/ssl.h +6300 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/test.h +4989 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/version.h +40 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/aes.h +1074 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/arc4.h +69 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ascon.h +109 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/asn.h +2855 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/asn_public.h +1009 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/blake2-impl.h +155 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/blake2-int.h +174 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/blake2.h +108 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/camellia.h +116 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/chacha.h +133 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/chacha20_poly1305.h +157 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/cmac.h +168 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/coding.h +107 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/compress.h +60 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/cpuid.h +153 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/cryptocb.h +770 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/curve25519.h +225 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/curve448.h +151 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/des3.h +167 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/dh.h +210 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/dilithium.h +1051 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/dsa.h +121 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ecc.h +1074 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/eccsi.h +176 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ed25519.h +239 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ed448.h +214 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/error-crypt.h +368 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ext_lms.h +62 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ext_mlkem.h +74 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ext_xmss.h +53 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/falcon.h +180 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/fe_448.h +122 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/fe_operations.h +189 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/fips_test.h +131 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ge_448.h +84 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ge_operations.h +134 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/hash.h +296 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/hmac.h +231 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/hpke.h +145 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/integer.h +449 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/kdf.h +199 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/lms.h +202 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/logging.h +588 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/md2.h +83 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/md4.h +77 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/md5.h +141 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/mem_track.h +968 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/memory.h +545 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/misc.h +214 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/mlkem.h +377 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/mpi_class.h +1021 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/mpi_superclass.h +96 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/oid_sum.h +1907 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/pkcs12.h +79 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/pkcs7.h +578 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/poly1305.h +207 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/pwdbased.h +81 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/random.h +300 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/rc2.h +68 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/ripemd.h +67 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/rsa.h +494 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sakke.h +228 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/settings.h +4762 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sha.h +237 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sha256.h +360 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sha3.h +274 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sha512.h +372 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/signature.h +87 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/siphash.h +101 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sm2.h +27 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sm3.h +27 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sm4.h +27 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sp_int.h +1396 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/sphincs.h +167 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/srp.h +313 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/tfm.h +941 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/types.h +2383 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/visibility.h +97 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_encrypt.h +126 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_lms.h +506 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_mlkem.h +370 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_port.h +1764 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wc_xmss.h +285 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wolfevent.h +120 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/wolfmath.h +175 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfcrypt/xmss.h +203 -0
- package/android/install/wolfssl-android/armeabi-v7a/include/wolfssl/wolfio.h +1035 -0
- package/android/install/wolfssl-android/armeabi-v7a/lib/libwolfssl.a +0 -0
- package/android/install/wolfssl-android/armeabi-v7a/lib/libwolfssl.la +41 -0
- package/android/install/wolfssl-android/armeabi-v7a/lib/pkgconfig/wolfssl.pc +11 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/QUIC.md +117 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/README.txt +8 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/async_client.c +245 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/async_server.c +331 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/client.c +4885 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/echoclient.c +341 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/echoserver.c +498 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/sctp-client-dtls.c +135 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/sctp-client.c +78 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/sctp-server-dtls.c +134 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/sctp-server.c +83 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/server.c +4124 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/example/tls_bench.c +2357 -0
- package/android/install/wolfssl-android/armeabi-v7a/share/doc/wolfssl/taoCert.txt +176 -0
- package/android/install/wolfssl-android/x86_64/bin/wolfssl-config +117 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/callbacks.h +93 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/certs_test.h +7073 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/certs_test_sm.h +2913 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/crl.h +58 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/error-ssl.h +280 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/ocsp.h +191 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/aes.h +117 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/asn1.h +315 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/asn1t.h +30 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/bio.h +237 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/bn.h +332 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/buffer.h +57 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/camellia.h +27 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/cmac.h +66 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/cms.h +26 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/compat_types.h +70 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/conf.h +117 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/crypto.h +171 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/des.h +124 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/dh.h +144 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/dsa.h +164 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ec.h +525 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ec25519.h +46 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ec448.h +46 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ecdh.h +49 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ecdsa.h +87 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ed25519.h +49 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ed448.h +49 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/engine.h +9 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/err.h +84 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/evp.h +1540 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/fips_rand.h +125 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/hmac.h +98 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/kdf.h +45 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/lhash.h +64 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/md4.h +66 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/md5.h +108 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/modes.h +45 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/obj_mac.h +92 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/objects.h +86 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ocsp.h +108 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/opensslconf.h +8 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/opensslv.h +78 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ossl_typ.h +32 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/pem.h +301 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/pkcs12.h +57 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/pkcs7.h +110 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/rand.h +38 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/rc4.h +64 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ripemd.h +58 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/rsa.h +291 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/safestack.h +40 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/sha.h +331 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/sha3.h +158 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/srp.h +33 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ssl.h +1923 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ssl23.h +1 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/stack.h +61 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/tls1.h +64 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/txt_db.h +60 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/ui.h +2 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/x509.h +227 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/x509_vfy.h +50 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/openssl/x509v3.h +237 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/options.h +273 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/quic.h +310 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/sniffer.h +359 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/sniffer_error.h +151 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/ssl.h +6300 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/test.h +4989 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/version.h +40 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/aes.h +1074 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/arc4.h +69 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ascon.h +109 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/asn.h +2855 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/asn_public.h +1009 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/blake2-impl.h +155 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/blake2-int.h +174 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/blake2.h +108 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/camellia.h +116 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/chacha.h +133 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/chacha20_poly1305.h +157 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/cmac.h +168 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/coding.h +107 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/compress.h +60 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/cpuid.h +153 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/cryptocb.h +770 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/curve25519.h +225 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/curve448.h +151 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/des3.h +167 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/dh.h +210 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/dilithium.h +1051 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/dsa.h +121 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ecc.h +1074 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/eccsi.h +176 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ed25519.h +239 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ed448.h +214 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/error-crypt.h +368 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ext_lms.h +62 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ext_mlkem.h +74 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ext_xmss.h +53 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/falcon.h +180 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/fe_448.h +122 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/fe_operations.h +189 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/fips_test.h +131 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ge_448.h +84 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ge_operations.h +134 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/hash.h +296 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/hmac.h +231 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/hpke.h +145 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/integer.h +449 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/kdf.h +199 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/lms.h +202 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/logging.h +588 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/md2.h +83 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/md4.h +77 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/md5.h +141 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/mem_track.h +968 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/memory.h +545 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/misc.h +214 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/mlkem.h +377 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/mpi_class.h +1021 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/mpi_superclass.h +96 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/oid_sum.h +1907 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/pkcs12.h +79 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/pkcs7.h +578 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/poly1305.h +207 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/pwdbased.h +81 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/random.h +300 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/rc2.h +68 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/ripemd.h +67 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/rsa.h +494 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sakke.h +228 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/settings.h +4762 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sha.h +237 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sha256.h +360 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sha3.h +274 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sha512.h +372 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/signature.h +87 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/siphash.h +101 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sm2.h +27 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sm3.h +27 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sm4.h +27 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sp_int.h +1396 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/sphincs.h +167 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/srp.h +313 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/tfm.h +941 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/types.h +2383 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/visibility.h +97 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_encrypt.h +126 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_lms.h +506 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_mlkem.h +370 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_port.h +1764 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wc_xmss.h +285 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wolfevent.h +120 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/wolfmath.h +175 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfcrypt/xmss.h +203 -0
- package/android/install/wolfssl-android/x86_64/include/wolfssl/wolfio.h +1035 -0
- package/android/install/wolfssl-android/x86_64/lib/libwolfssl.a +0 -0
- package/android/install/wolfssl-android/x86_64/lib/libwolfssl.la +41 -0
- package/android/install/wolfssl-android/x86_64/lib/pkgconfig/wolfssl.pc +11 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/QUIC.md +117 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/README.txt +8 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/async_client.c +245 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/async_server.c +331 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/client.c +4885 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/echoclient.c +341 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/echoserver.c +498 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/sctp-client-dtls.c +135 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/sctp-client.c +78 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/sctp-server-dtls.c +134 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/sctp-server.c +83 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/server.c +4124 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/example/tls_bench.c +2357 -0
- package/android/install/wolfssl-android/x86_64/share/doc/wolfssl/taoCert.txt +176 -0
- package/android/src/main/cpp/CMakeLists.txt +19 -27
- package/android/src/main/cpp/ngtcp2_jni.cpp +30 -36
- package/android/src/main/kotlin/ai/annadata/mqttquic/MqttQuicPlugin.kt +15 -0
- package/android/src/main/kotlin/ai/annadata/mqttquic/client/MQTTClient.kt +6 -2
- package/build-native.sh +397 -0
- package/deps-versions.sh +25 -0
- package/dist/esm/definitions.d.ts +20 -0
- package/dist/esm/definitions.d.ts.map +1 -1
- package/dist/esm/web.d.ts +26 -3
- package/dist/esm/web.d.ts.map +1 -1
- package/dist/esm/web.js +230 -10
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +11363 -13
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +11364 -14
- package/dist/plugin.js.map +1 -1
- package/docs/ARCHITECTURAL_ANALYSIS.md +710 -0
- package/docs/CAPACITOR_MQTT_QUIC_PRODUCTION_PLUGIN.md +190 -0
- package/docs/CAPACITOR_VERSION_SUPPORT.md +65 -0
- package/docs/IMPLEMENTATION_SUMMARY.md +246 -0
- package/docs/MQTT5_CLIENT_COMPLIANCE.md +48 -0
- package/docs/MQTT5_IMPLEMENTATION_COMPLETE.md +178 -0
- package/docs/MQTT_VERSION_ANALYSIS.md +233 -0
- package/docs/NGTCP2_IMPLEMENTATION_STATUS.md +214 -0
- package/docs/NGTCP2_INTEGRATION_PLAN.md +597 -0
- package/docs/P0_P1_CHANGELOG.md +79 -0
- package/docs/PRODUCTION_PUBLISH_STEPS.md +161 -0
- package/docs/PROJECT_OVERVIEW.md +193 -0
- package/ios/.swiftpm/xcode/xcuserdata/annadata.xcuserdatad/xcschemes/xcschememanagement.plist +1 -1
- package/ios/NGTCP2_BUILD_INSTRUCTIONS.md +12 -0
- package/ios/Sources/MqttQuicPlugin/MqttQuicPlugin.swift +6 -0
- package/ios/Sources/MqttQuicPlugin/QUIC/NGTCP2Bridge.mm +6 -0
- package/ios/build-openssl.sh +1 -1
- package/ios/libs/MqttQuicLibs.xcframework/Info.plist +44 -0
- package/ios/libs/MqttQuicLibs.xcframework/ios-arm64/libmqttquic_native_device.a +0 -0
- package/ios/libs/MqttQuicLibs.xcframework/ios-arm64_x86_64-simulator/libmqttquic_native_simulator.a +0 -0
- package/ios/libs/libnghttp3.a +0 -0
- package/ios/libs/libngtcp2.a +0 -0
- package/ios/libs/libngtcp2_crypto_wolfssl.a +0 -0
- package/ios/libs/libwolfssl.a +0 -0
- package/ios/libs-simulator/libnghttp3.a +0 -0
- package/ios/libs-simulator/libngtcp2.a +0 -0
- package/ios/libs-simulator/libngtcp2_crypto_wolfssl.a +0 -0
- package/ios/libs-simulator/libwolfssl.a +0 -0
- package/ios/libs-simulator-x86_64/libnghttp3.a +0 -0
- package/ios/libs-simulator-x86_64/libngtcp2.a +0 -0
- package/ios/libs-simulator-x86_64/libngtcp2_crypto_wolfssl.a +0 -0
- package/ios/libs-simulator-x86_64/libwolfssl.a +0 -0
- package/package.json +22 -9
|
@@ -0,0 +1,2383 @@
|
|
|
1
|
+
/* types.h
|
|
2
|
+
*
|
|
3
|
+
* Copyright (C) 2006-2025 wolfSSL Inc.
|
|
4
|
+
*
|
|
5
|
+
* This file is part of wolfSSL.
|
|
6
|
+
*
|
|
7
|
+
* wolfSSL is free software; you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU General Public License as published by
|
|
9
|
+
* the Free Software Foundation; either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* wolfSSL is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU General Public License
|
|
18
|
+
* along with this program; if not, write to the Free Software
|
|
19
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/*!
|
|
23
|
+
\file wolfssl/wolfcrypt/types.h
|
|
24
|
+
*/
|
|
25
|
+
/*
|
|
26
|
+
DESCRIPTION
|
|
27
|
+
This library defines the primitive data types and abstraction macros to
|
|
28
|
+
decouple library dependencies with standard string, memory and so on.
|
|
29
|
+
|
|
30
|
+
*/
|
|
31
|
+
#ifndef WOLF_CRYPT_TYPES_H
|
|
32
|
+
#define WOLF_CRYPT_TYPES_H
|
|
33
|
+
|
|
34
|
+
#include <wolfssl/wolfcrypt/settings.h>
|
|
35
|
+
#include <wolfssl/wolfcrypt/wc_port.h>
|
|
36
|
+
#include <wolfssl/wolfcrypt/oid_sum.h>
|
|
37
|
+
|
|
38
|
+
#if defined(EXTERNAL_OPTS_OPENVPN) && defined(BUILDING_WOLFSSL)
|
|
39
|
+
#error EXTERNAL_OPTS_OPENVPN should not be defined in compiled wolfssl \
|
|
40
|
+
library files.
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
#ifdef __APPLE__
|
|
44
|
+
#include <AvailabilityMacros.h>
|
|
45
|
+
#endif
|
|
46
|
+
|
|
47
|
+
#ifdef __cplusplus
|
|
48
|
+
extern "C" {
|
|
49
|
+
#endif
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
* This struct is used multiple time by other structs and
|
|
54
|
+
* needs to be defined somewhere that all structs can import
|
|
55
|
+
* (with minimal dependencies).
|
|
56
|
+
*/
|
|
57
|
+
#ifdef HAVE_EX_DATA
|
|
58
|
+
#ifdef HAVE_EX_DATA_CLEANUP_HOOKS
|
|
59
|
+
typedef void (*wolfSSL_ex_data_cleanup_routine_t)(void *data);
|
|
60
|
+
#endif
|
|
61
|
+
typedef struct WOLFSSL_CRYPTO_EX_DATA {
|
|
62
|
+
void* ex_data[MAX_EX_DATA];
|
|
63
|
+
#ifdef HAVE_EX_DATA_CLEANUP_HOOKS
|
|
64
|
+
wolfSSL_ex_data_cleanup_routine_t
|
|
65
|
+
ex_data_cleanup_routines[MAX_EX_DATA];
|
|
66
|
+
#endif
|
|
67
|
+
} WOLFSSL_CRYPTO_EX_DATA;
|
|
68
|
+
typedef void (WOLFSSL_CRYPTO_EX_new)(void* p, void* ptr,
|
|
69
|
+
WOLFSSL_CRYPTO_EX_DATA* a, int idx, long argValue, void* arg);
|
|
70
|
+
typedef int (WOLFSSL_CRYPTO_EX_dup)(WOLFSSL_CRYPTO_EX_DATA* out,
|
|
71
|
+
const WOLFSSL_CRYPTO_EX_DATA* in, void* inPtr, int idx,
|
|
72
|
+
long argV, void* arg);
|
|
73
|
+
typedef void (WOLFSSL_CRYPTO_EX_free)(void* p, void* ptr,
|
|
74
|
+
WOLFSSL_CRYPTO_EX_DATA* a, int idx, long argValue, void* arg);
|
|
75
|
+
#endif
|
|
76
|
+
|
|
77
|
+
#if defined(WORDS_BIGENDIAN)
|
|
78
|
+
#define BIG_ENDIAN_ORDER
|
|
79
|
+
#endif
|
|
80
|
+
|
|
81
|
+
#ifndef BIG_ENDIAN_ORDER
|
|
82
|
+
#define LITTLE_ENDIAN_ORDER
|
|
83
|
+
#endif
|
|
84
|
+
|
|
85
|
+
#ifndef WOLFSSL_TYPES
|
|
86
|
+
#define WOLFSSL_TYPES
|
|
87
|
+
#ifndef byte
|
|
88
|
+
/* If using C++ C17 or later and getting:
|
|
89
|
+
* "error: reference to 'byte' is ambiguous", this is caused by
|
|
90
|
+
* cstddef conflict with "std::byte" in
|
|
91
|
+
* "enum class byte : unsigned char {};".
|
|
92
|
+
* This can occur if the user application is using "std" as the
|
|
93
|
+
* default namespace before including wolfSSL headers.
|
|
94
|
+
* Workarounds: https://github.com/wolfSSL/wolfssl/issues/5400
|
|
95
|
+
*/
|
|
96
|
+
typedef unsigned char byte;
|
|
97
|
+
#endif
|
|
98
|
+
typedef signed char sword8;
|
|
99
|
+
typedef unsigned char word8;
|
|
100
|
+
#ifdef WC_16BIT_CPU
|
|
101
|
+
typedef int sword16;
|
|
102
|
+
typedef unsigned int word16;
|
|
103
|
+
typedef long sword32;
|
|
104
|
+
typedef unsigned long word32;
|
|
105
|
+
#else
|
|
106
|
+
typedef short sword16;
|
|
107
|
+
typedef unsigned short word16;
|
|
108
|
+
typedef int sword32;
|
|
109
|
+
typedef unsigned int word32;
|
|
110
|
+
#endif
|
|
111
|
+
typedef byte word24[3];
|
|
112
|
+
#endif
|
|
113
|
+
|
|
114
|
+
typedef const char wcchar[];
|
|
115
|
+
|
|
116
|
+
#ifndef WC_BITFIELD
|
|
117
|
+
#ifdef WOLF_C89
|
|
118
|
+
#define WC_BITFIELD unsigned
|
|
119
|
+
#else
|
|
120
|
+
#define WC_BITFIELD byte
|
|
121
|
+
#endif
|
|
122
|
+
#endif
|
|
123
|
+
|
|
124
|
+
#ifndef HAVE_ANONYMOUS_INLINE_AGGREGATES
|
|
125
|
+
/* if a version is available, pivot on the version, otherwise guess it's
|
|
126
|
+
* disallowed, subject to override.
|
|
127
|
+
*/
|
|
128
|
+
#if !defined(WOLF_C89) && (!defined(__STDC__) \
|
|
129
|
+
|| (!defined(__STDC_VERSION__) && !defined(__cplusplus)) \
|
|
130
|
+
|| (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201101L)) \
|
|
131
|
+
|| (defined(__cplusplus) && (__cplusplus >= 201103L)))
|
|
132
|
+
#define HAVE_ANONYMOUS_INLINE_AGGREGATES 1
|
|
133
|
+
#endif
|
|
134
|
+
#elif ~(~HAVE_ANONYMOUS_INLINE_AGGREGATES + 1) == 1
|
|
135
|
+
/* forced on with empty value -- remap to 1 */
|
|
136
|
+
#undef HAVE_ANONYMOUS_INLINE_AGGREGATES
|
|
137
|
+
#define HAVE_ANONYMOUS_INLINE_AGGREGATES 1
|
|
138
|
+
#elif HAVE_ANONYMOUS_INLINE_AGGREGATES
|
|
139
|
+
/* forced on with explicit nonzero value -- leave as-is. */
|
|
140
|
+
#else
|
|
141
|
+
/* forced off with explicit zero value -- remap to undef. */
|
|
142
|
+
#undef HAVE_ANONYMOUS_INLINE_AGGREGATES
|
|
143
|
+
#endif
|
|
144
|
+
|
|
145
|
+
#ifndef HAVE_EMPTY_AGGREGATES
|
|
146
|
+
/* The C standards don't define empty aggregates, but gcc and clang do.
|
|
147
|
+
* We need to accommodate them for one of the same reasons C++ does --
|
|
148
|
+
* conditionally empty aggregates, e.g. in hash.h.
|
|
149
|
+
*
|
|
150
|
+
* Nonetheless, in C++, empty aggregates wind up with size 1. If we use
|
|
151
|
+
* the [0] construct and the header is compiled by clang++, it warns
|
|
152
|
+
* "struct has size 0 in C, size 1 in C++ [-Wextern-c-compat]", despite
|
|
153
|
+
* the extern "C" wrapper. We sidestep this warning by recognizing
|
|
154
|
+
* here that C++ doesn't support truly empty aggregates. LLVM, for its
|
|
155
|
+
* part, deprecates compilation of C code as C++ using clang++.
|
|
156
|
+
*/
|
|
157
|
+
#if !defined(WOLF_C89) && defined(__GNUC__) && \
|
|
158
|
+
!defined(__STRICT_ANSI__) && \
|
|
159
|
+
!defined(__cplusplus) && \
|
|
160
|
+
defined(HAVE_ANONYMOUS_INLINE_AGGREGATES)
|
|
161
|
+
#define HAVE_EMPTY_AGGREGATES 1
|
|
162
|
+
#endif
|
|
163
|
+
#elif ~(~HAVE_EMPTY_AGGREGATES + 1) == 1
|
|
164
|
+
/* forced on with empty value -- remap to 1 */
|
|
165
|
+
#undef HAVE_EMPTY_AGGREGATES
|
|
166
|
+
#define HAVE_EMPTY_AGGREGATES 1
|
|
167
|
+
#elif HAVE_EMPTY_AGGREGATES
|
|
168
|
+
/* forced on with explicit nonzero value -- leave as-is. */
|
|
169
|
+
#else
|
|
170
|
+
/* forced off with explicit zero value -- remap to undef. */
|
|
171
|
+
#undef HAVE_EMPTY_AGGREGATES
|
|
172
|
+
#endif
|
|
173
|
+
|
|
174
|
+
#define _WOLF_AGG_DUMMY_MEMBER_HELPER2(a, b, c) a ## b ## c
|
|
175
|
+
#define _WOLF_AGG_DUMMY_MEMBER_HELPER(a, b, c) \
|
|
176
|
+
_WOLF_AGG_DUMMY_MEMBER_HELPER2(a, b, c)
|
|
177
|
+
#ifdef HAVE_EMPTY_AGGREGATES
|
|
178
|
+
/* swallow the semicolon with a zero-sized array (language extension
|
|
179
|
+
* specific to gcc/clang).
|
|
180
|
+
*/
|
|
181
|
+
#define WOLF_AGG_DUMMY_MEMBER \
|
|
182
|
+
struct { \
|
|
183
|
+
PRAGMA_GCC_DIAG_PUSH \
|
|
184
|
+
PRAGMA_GCC("GCC diagnostic ignored \"-Wpedantic\"") \
|
|
185
|
+
PRAGMA_CLANG_DIAG_PUSH \
|
|
186
|
+
PRAGMA_CLANG("clang diagnostic ignored \"-Wzero-length-array\"") \
|
|
187
|
+
byte _WOLF_AGG_DUMMY_MEMBER_HELPER(_wolf_L, __LINE__, \
|
|
188
|
+
_agg_dummy_member)[0]; \
|
|
189
|
+
PRAGMA_CLANG_DIAG_POP \
|
|
190
|
+
PRAGMA_GCC_DIAG_POP \
|
|
191
|
+
}
|
|
192
|
+
#else
|
|
193
|
+
/* Use a single byte with a constructed name as a dummy member -- these
|
|
194
|
+
* are the standard semantics of an empty structure in C++.
|
|
195
|
+
*/
|
|
196
|
+
#define WOLF_AGG_DUMMY_MEMBER char _WOLF_AGG_DUMMY_MEMBER_HELPER( \
|
|
197
|
+
_wolf_L, __LINE__, _agg_dummy_member)
|
|
198
|
+
#endif
|
|
199
|
+
|
|
200
|
+
/* helpers for stringifying the expanded value of a macro argument rather
|
|
201
|
+
* than its literal text:
|
|
202
|
+
*/
|
|
203
|
+
#define _WC_STRINGIFY_L2(str) #str
|
|
204
|
+
#define WC_STRINGIFY(str) _WC_STRINGIFY_L2(str)
|
|
205
|
+
|
|
206
|
+
/* With a true C89-dialect compiler (simulate with gcc -std=c89 -Wall
|
|
207
|
+
* -Wextra -pedantic), a trailing comma on the last value in an enum
|
|
208
|
+
* definition is a syntax error. We use this macro to accommodate that
|
|
209
|
+
* without disrupting clean flow/syntax when some enum values are
|
|
210
|
+
* preprocessor-gated.
|
|
211
|
+
*/
|
|
212
|
+
#if defined(WOLF_C89) || defined(WOLF_NO_TRAILING_ENUM_COMMAS)
|
|
213
|
+
#define _WOLF_ENUM_DUMMY_LAST_ELEMENT_HELPER2(a, b, c, d, e) \
|
|
214
|
+
a ## b ## c ## d ## e
|
|
215
|
+
#define _WOLF_ENUM_DUMMY_LAST_ELEMENT_HELPER(a, b, c, d, e) \
|
|
216
|
+
_WOLF_ENUM_DUMMY_LAST_ELEMENT_HELPER2(a, b, c, d, e)
|
|
217
|
+
#define WOLF_ENUM_DUMMY_LAST_ELEMENT(prefix) \
|
|
218
|
+
_WOLF_ENUM_DUMMY_LAST_ELEMENT_HELPER(_wolf_, prefix, _L, __LINE__, \
|
|
219
|
+
_enum_dummy_last_element)
|
|
220
|
+
#else
|
|
221
|
+
#define WOLF_ENUM_DUMMY_LAST_ELEMENT(prefix) /* null expansion */
|
|
222
|
+
#endif
|
|
223
|
+
|
|
224
|
+
/* try to set SIZEOF_LONG or SIZEOF_LONG_LONG if user didn't */
|
|
225
|
+
#if defined(_WIN32) || defined(HAVE_LIMITS_H)
|
|
226
|
+
#include <limits.h>
|
|
227
|
+
/* make sure both SIZEOF_LONG_LONG and SIZEOF_LONG are set,
|
|
228
|
+
* otherwise causes issues with CTC_SETTINGS */
|
|
229
|
+
#if !defined(SIZEOF_LONG_LONG) || !defined(SIZEOF_LONG)
|
|
230
|
+
#if !defined(SIZEOF_LONG) && defined(ULONG_MAX) && \
|
|
231
|
+
(ULONG_MAX == 0xffffffffUL)
|
|
232
|
+
#define SIZEOF_LONG 4
|
|
233
|
+
#endif
|
|
234
|
+
#if !defined(SIZEOF_LONG_LONG) && defined(ULLONG_MAX) && \
|
|
235
|
+
(ULLONG_MAX == 0xffffffffffffffffULL)
|
|
236
|
+
#define SIZEOF_LONG_LONG 8
|
|
237
|
+
#endif
|
|
238
|
+
#endif
|
|
239
|
+
#elif !defined(__BCPLUSPLUS__) && !defined(__EMSCRIPTEN__)
|
|
240
|
+
#if !defined(SIZEOF_LONG_LONG) && !defined(SIZEOF_LONG)
|
|
241
|
+
#if (defined(__alpha__) || defined(__ia64__) || \
|
|
242
|
+
defined(_ARCH_PPC64) || defined(__ppc64__) || \
|
|
243
|
+
defined(__x86_64__) || defined(__s390x__ ) || \
|
|
244
|
+
((defined(sun) || defined(__sun)) && \
|
|
245
|
+
(defined(LP64) || defined(_LP64))) || \
|
|
246
|
+
(defined(__riscv_xlen) && (__riscv_xlen == 64)) || \
|
|
247
|
+
defined(__aarch64__) || defined(__mips64) || \
|
|
248
|
+
(defined(__DCC__) && (defined(__LP64) || defined(__LP64__))))
|
|
249
|
+
/* long should be 64bit */
|
|
250
|
+
#define SIZEOF_LONG 8
|
|
251
|
+
#elif defined(__i386__) || defined(__CORTEX_M3__) || defined(__ppc__)
|
|
252
|
+
/* long long should be 64bit */
|
|
253
|
+
#define SIZEOF_LONG_LONG 8
|
|
254
|
+
#endif
|
|
255
|
+
#endif
|
|
256
|
+
#endif
|
|
257
|
+
|
|
258
|
+
#if (defined(_MSC_VER) && (_MSC_VER == 1200)) || /* MSVC6 */ \
|
|
259
|
+
(defined(_MSC_VER) && !defined(WOLFSSL_NOT_WINDOWS_API)) || \
|
|
260
|
+
defined(__BCPLUSPLUS__) || \
|
|
261
|
+
(defined(__WATCOMC__) && defined(__WATCOM_INT64__))
|
|
262
|
+
/* windows types */
|
|
263
|
+
#define WORD64_AVAILABLE
|
|
264
|
+
#define W64LIT(x) x##ui64
|
|
265
|
+
#define SW64LIT(x) x##i64
|
|
266
|
+
typedef __int64 sword64;
|
|
267
|
+
typedef unsigned __int64 word64;
|
|
268
|
+
#elif defined(__EMSCRIPTEN__)
|
|
269
|
+
#define WORD64_AVAILABLE
|
|
270
|
+
#define W64LIT(x) x##ull
|
|
271
|
+
#define SW64LIT(x) x##ll
|
|
272
|
+
typedef long long sword64;
|
|
273
|
+
typedef unsigned long long word64;
|
|
274
|
+
#elif defined(SIZEOF_LONG) && SIZEOF_LONG == 8
|
|
275
|
+
#define WORD64_AVAILABLE
|
|
276
|
+
#ifdef WOLF_C89
|
|
277
|
+
#define W64LIT(x) x##UL
|
|
278
|
+
#define SW64LIT(x) x##L
|
|
279
|
+
#else
|
|
280
|
+
#define W64LIT(x) x##ULL
|
|
281
|
+
#define SW64LIT(x) x##LL
|
|
282
|
+
#endif
|
|
283
|
+
typedef long sword64;
|
|
284
|
+
typedef unsigned long word64;
|
|
285
|
+
#elif defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG == 8
|
|
286
|
+
#define WORD64_AVAILABLE
|
|
287
|
+
#ifdef WOLF_C89
|
|
288
|
+
#define W64LIT(x) x##UL
|
|
289
|
+
#define SW64LIT(x) x##L
|
|
290
|
+
#else
|
|
291
|
+
#define W64LIT(x) x##ULL
|
|
292
|
+
#define SW64LIT(x) x##LL
|
|
293
|
+
#endif
|
|
294
|
+
typedef long long sword64;
|
|
295
|
+
typedef unsigned long long word64;
|
|
296
|
+
#elif defined(__SIZEOF_LONG_LONG__) && __SIZEOF_LONG_LONG__ == 8
|
|
297
|
+
#define WORD64_AVAILABLE
|
|
298
|
+
#ifdef WOLF_C89
|
|
299
|
+
#define W64LIT(x) x##UL
|
|
300
|
+
#define SW64LIT(x) x##L
|
|
301
|
+
#else
|
|
302
|
+
#define W64LIT(x) x##ULL
|
|
303
|
+
#define SW64LIT(x) x##LL
|
|
304
|
+
#endif
|
|
305
|
+
typedef long long sword64;
|
|
306
|
+
typedef unsigned long long word64;
|
|
307
|
+
#endif
|
|
308
|
+
|
|
309
|
+
#if defined(WORD64_AVAILABLE) && !defined(WC_16BIT_CPU)
|
|
310
|
+
/* These platforms have 64-bit CPU registers. */
|
|
311
|
+
#if (defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || \
|
|
312
|
+
(defined(__mips64) && \
|
|
313
|
+
((defined(_ABI64) && (_MIPS_SIM == _ABI64)) || \
|
|
314
|
+
(defined(_ABIO64) && (_MIPS_SIM == _ABIO64)))) || \
|
|
315
|
+
defined(__x86_64__) || defined(_M_X64)) || \
|
|
316
|
+
defined(__aarch64__) || defined(__sparc64__) || defined(__s390x__ ) || \
|
|
317
|
+
(defined(__riscv_xlen) && (__riscv_xlen == 64)) || defined(_M_ARM64) || \
|
|
318
|
+
defined(__aarch64__) || defined(__ppc64__) || \
|
|
319
|
+
(defined(__DCC__) && (defined(__LP64) || defined(__LP64__)))
|
|
320
|
+
#define WC_64BIT_CPU
|
|
321
|
+
#elif (defined(sun) || defined(__sun)) && \
|
|
322
|
+
(defined(LP64) || defined(_LP64))
|
|
323
|
+
/* LP64 with GNU GCC compiler is reserved for when long int is 64 bits
|
|
324
|
+
* and int uses 32 bits. When using Solaris Studio sparc and __sparc are
|
|
325
|
+
* available for 32 bit detection but __sparc64__ could be missed. This
|
|
326
|
+
* uses LP64 for checking 64 bit CPU arch. */
|
|
327
|
+
#define WC_64BIT_CPU
|
|
328
|
+
#else
|
|
329
|
+
#define WC_32BIT_CPU
|
|
330
|
+
#endif
|
|
331
|
+
|
|
332
|
+
#if defined(NO_64BIT)
|
|
333
|
+
typedef word32 wolfssl_word;
|
|
334
|
+
#define WOLFSSL_WORD_SIZE_LOG2 2
|
|
335
|
+
#undef WORD64_AVAILABLE
|
|
336
|
+
#else
|
|
337
|
+
#ifdef WC_64BIT_CPU
|
|
338
|
+
typedef word64 wolfssl_word;
|
|
339
|
+
#define WOLFSSL_WORD_SIZE_LOG2 3
|
|
340
|
+
#else
|
|
341
|
+
typedef word32 wolfssl_word;
|
|
342
|
+
#define WOLFSSL_WORD_SIZE_LOG2 2
|
|
343
|
+
#ifdef WORD64_AVAILABLE
|
|
344
|
+
#define WOLFCRYPT_SLOW_WORD64
|
|
345
|
+
#endif
|
|
346
|
+
#endif
|
|
347
|
+
#endif
|
|
348
|
+
|
|
349
|
+
#elif defined(WC_16BIT_CPU)
|
|
350
|
+
#ifndef MICROCHIP_PIC24
|
|
351
|
+
#undef WORD64_AVAILABLE
|
|
352
|
+
#endif
|
|
353
|
+
typedef word16 wolfssl_word;
|
|
354
|
+
#define WOLFSSL_WORD_SIZE_LOG2 1
|
|
355
|
+
#define MP_16BIT /* for mp_int, mp_word needs to be twice as big as \
|
|
356
|
+
* mp_digit, no 64 bit type so make mp_digit 16 bit */
|
|
357
|
+
|
|
358
|
+
#else
|
|
359
|
+
#undef WORD64_AVAILABLE
|
|
360
|
+
typedef word32 wolfssl_word;
|
|
361
|
+
#define WOLFSSL_WORD_SIZE_LOG2 2
|
|
362
|
+
#define MP_16BIT /* for mp_int, mp_word needs to be twice as big as \
|
|
363
|
+
* mp_digit, no 64 bit type so make mp_digit 16 bit */
|
|
364
|
+
#endif
|
|
365
|
+
|
|
366
|
+
typedef struct w64wrapper {
|
|
367
|
+
#if defined(WORD64_AVAILABLE) && !defined(WOLFSSL_W64_WRAPPER_TEST)
|
|
368
|
+
word64 n;
|
|
369
|
+
#else
|
|
370
|
+
word32 n[2];
|
|
371
|
+
#endif /* WORD64_AVAILABLE && WOLFSSL_W64_WRAPPER_TEST */
|
|
372
|
+
} w64wrapper;
|
|
373
|
+
|
|
374
|
+
#ifdef WC_PTR_TYPE /* Allow user supplied type */
|
|
375
|
+
typedef WC_PTR_TYPE wc_ptr_t;
|
|
376
|
+
#elif defined(HAVE_UINTPTR_T)
|
|
377
|
+
#ifndef NO_STDINT_H
|
|
378
|
+
#include <stdint.h>
|
|
379
|
+
#endif
|
|
380
|
+
typedef uintptr_t wc_ptr_t;
|
|
381
|
+
#else /* fallback to architecture size_t for pointer size */
|
|
382
|
+
#include <stddef.h> /* included for getting size_t type */
|
|
383
|
+
typedef size_t wc_ptr_t;
|
|
384
|
+
#endif
|
|
385
|
+
|
|
386
|
+
enum {
|
|
387
|
+
WOLFSSL_WORD_SIZE = sizeof(wolfssl_word),
|
|
388
|
+
WOLFSSL_BIT_SIZE = 8,
|
|
389
|
+
WOLFSSL_WORD_BITS = WOLFSSL_WORD_SIZE * WOLFSSL_BIT_SIZE
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
#define WOLFSSL_MAX_8BIT 0xffU
|
|
393
|
+
#define WOLFSSL_MAX_16BIT 0xffffU
|
|
394
|
+
#define WOLFSSL_MAX_32BIT 0xffffffffU
|
|
395
|
+
|
|
396
|
+
#ifndef WC_DO_NOTHING
|
|
397
|
+
#define WC_DO_NOTHING do {} while (0)
|
|
398
|
+
#ifdef _MSC_VER
|
|
399
|
+
/* disable buggy MSC warning around while(0),
|
|
400
|
+
*"warning C4127: conditional expression is constant"
|
|
401
|
+
*/
|
|
402
|
+
#pragma warning(disable: 4127)
|
|
403
|
+
#endif
|
|
404
|
+
#endif
|
|
405
|
+
|
|
406
|
+
#if defined(HAVE_FIPS) || defined(HAVE_SELFTEST)
|
|
407
|
+
#define INLINE WC_INLINE
|
|
408
|
+
#endif
|
|
409
|
+
|
|
410
|
+
/* set up rotate style */
|
|
411
|
+
#if ((defined(_MSC_VER) && !defined(WOLFSSL_NOT_WINDOWS_API)) || \
|
|
412
|
+
defined(__BCPLUSPLUS__)) && !defined(WOLFSSL_SGX) && \
|
|
413
|
+
!defined(INTIME_RTOS)
|
|
414
|
+
#define INTEL_INTRINSICS
|
|
415
|
+
#define FAST_ROTATE
|
|
416
|
+
#elif defined(__MWERKS__) && TARGET_CPU_PPC
|
|
417
|
+
#define PPC_INTRINSICS
|
|
418
|
+
#define FAST_ROTATE
|
|
419
|
+
#elif defined(__CCRX__)
|
|
420
|
+
#define FAST_ROTATE
|
|
421
|
+
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
|
422
|
+
/* GCC does peephole optimizations which should result in using rotate
|
|
423
|
+
instructions */
|
|
424
|
+
#define FAST_ROTATE
|
|
425
|
+
#endif
|
|
426
|
+
|
|
427
|
+
/* set up thread local storage if available */
|
|
428
|
+
#if defined(HAVE_THREAD_LS) && !defined(NO_THREAD_LS)
|
|
429
|
+
#if defined(_MSC_VER) || defined(__WATCOMC__)
|
|
430
|
+
#define THREAD_LS_T __declspec(thread)
|
|
431
|
+
/* Thread local storage only in FreeRTOS v8.2.1 and higher */
|
|
432
|
+
#elif defined(FREERTOS) || defined(FREERTOS_TCP) || \
|
|
433
|
+
defined(WOLFSSL_ZEPHYR)
|
|
434
|
+
#define THREAD_LS_T
|
|
435
|
+
#else
|
|
436
|
+
#define THREAD_LS_T __thread
|
|
437
|
+
#endif
|
|
438
|
+
#else
|
|
439
|
+
#define THREAD_LS_T
|
|
440
|
+
#endif
|
|
441
|
+
|
|
442
|
+
#ifndef FALL_THROUGH
|
|
443
|
+
/* GCC 7 has new switch() fall-through detection */
|
|
444
|
+
#if defined(__GNUC__)
|
|
445
|
+
#if defined(fallthrough)
|
|
446
|
+
#define FALL_THROUGH fallthrough
|
|
447
|
+
#elif ((__GNUC__ > 7) || ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 1)))
|
|
448
|
+
#define FALL_THROUGH ; __attribute__ ((fallthrough))
|
|
449
|
+
#elif defined(__clang__) && defined(__clang_major__) && \
|
|
450
|
+
(__clang_major__ >= 12)
|
|
451
|
+
#define FALL_THROUGH ; __attribute__ ((fallthrough))
|
|
452
|
+
#endif
|
|
453
|
+
#endif
|
|
454
|
+
#endif /* FALL_THROUGH */
|
|
455
|
+
#if !defined(FALL_THROUGH) || defined(__XC32)
|
|
456
|
+
/* use stub for fall through by default or for Microchip compiler */
|
|
457
|
+
#undef FALL_THROUGH
|
|
458
|
+
#define FALL_THROUGH
|
|
459
|
+
#endif
|
|
460
|
+
|
|
461
|
+
#define XSTR_SIZEOF(x) (sizeof(x) - 1) /* -1 to not count the null char */
|
|
462
|
+
|
|
463
|
+
#define XELEM_CNT(x) (sizeof((x))/sizeof(*(x)))
|
|
464
|
+
|
|
465
|
+
#ifdef NO_INLINE
|
|
466
|
+
#define WC_WUR_INT(x) (x)
|
|
467
|
+
#else
|
|
468
|
+
static WC_INLINE WARN_UNUSED_RESULT int WC_WUR_INT(int x) { return x; }
|
|
469
|
+
#endif
|
|
470
|
+
|
|
471
|
+
#ifdef WORD64_AVAILABLE
|
|
472
|
+
#define WC_MAX_UINT_OF(x) \
|
|
473
|
+
((x)((((word64)1 << ((sizeof(x) * (word64)CHAR_BIT) - \
|
|
474
|
+
(word64)1)) - (word64)1) \
|
|
475
|
+
| \
|
|
476
|
+
((word64)1 << \
|
|
477
|
+
((sizeof(x) * (word64)CHAR_BIT) - (word64)1))))
|
|
478
|
+
#define WC_MAX_SINT_OF(x) \
|
|
479
|
+
((x)((sword64)((((word64)1 << \
|
|
480
|
+
((sizeof(x) * (word64)CHAR_BIT) - \
|
|
481
|
+
(word64)2)) - (word64)1) \
|
|
482
|
+
| \
|
|
483
|
+
((word64)1 << \
|
|
484
|
+
((sizeof(x) * (word64)CHAR_BIT) - \
|
|
485
|
+
(word64)2)))))
|
|
486
|
+
#else
|
|
487
|
+
#define WC_MAX_UINT_OF(x) \
|
|
488
|
+
((x)((((word32)1 << ((sizeof(x) * (word32)CHAR_BIT) - \
|
|
489
|
+
(word32)1)) - (word32)1) \
|
|
490
|
+
| \
|
|
491
|
+
((word32)1 << \
|
|
492
|
+
((sizeof(x) * (word32)CHAR_BIT) - (word32)1))))
|
|
493
|
+
#define WC_MAX_SINT_OF(x) \
|
|
494
|
+
((x)((sword32)((((word32)1 << \
|
|
495
|
+
((sizeof(x) * (word32)CHAR_BIT) - \
|
|
496
|
+
(word32)2)) - (word32)1) \
|
|
497
|
+
| \
|
|
498
|
+
((word32)1 << \
|
|
499
|
+
((sizeof(x) * (word32)CHAR_BIT) - \
|
|
500
|
+
(word32)2)))))
|
|
501
|
+
#endif
|
|
502
|
+
#define WC_MIN_SINT_OF(x) (-WC_MAX_SINT_OF(x) - 1)
|
|
503
|
+
|
|
504
|
+
/* The _CLIP variants of the safe arithmetic macros always store a value to out,
|
|
505
|
+
* but if the result is too large to represent in the type, out is set to the
|
|
506
|
+
* largest representable value with same sign as the actual result ("clipped").
|
|
507
|
+
*
|
|
508
|
+
* The non-_CLIP variants do not store a value if the result can't be accurately
|
|
509
|
+
* represented, and their return values must be checked.
|
|
510
|
+
*
|
|
511
|
+
* Both _CLIP and non-_CLIP macros return 1 if the result could be represented
|
|
512
|
+
* by the type, and 0 if not.
|
|
513
|
+
*/
|
|
514
|
+
|
|
515
|
+
#define WC_SAFE_SUM_UNSIGNED_CLIP(type, in1, in2, out) \
|
|
516
|
+
((in2) <= (WC_MAX_UINT_OF(type) - (in1)) ? \
|
|
517
|
+
((out) = (in1) + (in2), \
|
|
518
|
+
/* coverity[INTEGER_OVERFLOW] */ 1) : \
|
|
519
|
+
((out) = WC_MAX_UINT_OF(type), 0))
|
|
520
|
+
|
|
521
|
+
#define WC_SAFE_SUB_UNSIGNED_CLIP(type, in1, in2, out) \
|
|
522
|
+
((in2) <= (in1) ? \
|
|
523
|
+
((out) = (in1) - (in2), \
|
|
524
|
+
/* coverity[INTEGER_UNDERFLOW] */ 1) : \
|
|
525
|
+
((out) = 0, 0))
|
|
526
|
+
|
|
527
|
+
#define WC_SAFE_SUM_UNSIGNED(type, in1, in2, out) WC_WUR_INT( \
|
|
528
|
+
((in2) <= (WC_MAX_UINT_OF(type) - (in1)) ? \
|
|
529
|
+
((out) = (in1) + (in2), \
|
|
530
|
+
/* coverity[INTEGER_OVERFLOW] */ 1) : \
|
|
531
|
+
0))
|
|
532
|
+
|
|
533
|
+
#define WC_SAFE_SUB_UNSIGNED(type, in1, in2, out) WC_WUR_INT( \
|
|
534
|
+
((in2) <= (in1) ? \
|
|
535
|
+
((out) = (in1) - (in2), \
|
|
536
|
+
/* coverity[INTEGER_UNDERFLOW] */ 1) : \
|
|
537
|
+
0))
|
|
538
|
+
|
|
539
|
+
#if defined(HAVE_SELFTEST) || (defined(HAVE_FIPS) && FIPS_VERSION3_LE(6,0,0))
|
|
540
|
+
#define WC_SAFE_SUM_WORD32(in1, in2, out) \
|
|
541
|
+
WC_SAFE_SUM_UNSIGNED_CLIP(word32, in1, in2, out)
|
|
542
|
+
#else
|
|
543
|
+
#define WC_SAFE_SUM_WORD32(in1, in2, out) \
|
|
544
|
+
WC_SAFE_SUM_UNSIGNED(word32, in1, in2, out)
|
|
545
|
+
#endif
|
|
546
|
+
|
|
547
|
+
#define WC_SAFE_SUM_SIGNED_CLIP(type, in1, in2, out) \
|
|
548
|
+
((((in1) > 0) && ((in2) > 0)) ? \
|
|
549
|
+
((in2) <= WC_MAX_SINT_OF(type) - (in1) ? \
|
|
550
|
+
((out) = (in1) + (in2), \
|
|
551
|
+
/* coverity[INTEGER_OVERFLOW] */ 1) : \
|
|
552
|
+
((out) = (type)WC_MAX_SINT_OF(type), 0)) \
|
|
553
|
+
: \
|
|
554
|
+
((((in1) < 0) && ((in2) < 0)) ? \
|
|
555
|
+
((in2) >= WC_MIN_SINT_OF(type) - (in1) ? \
|
|
556
|
+
((out) = (in1) + (in2), \
|
|
557
|
+
/* coverity[INTEGER_OVERFLOW] */ 1) : \
|
|
558
|
+
((out) = (type)WC_MIN_SINT_OF(type), 0)) \
|
|
559
|
+
: \
|
|
560
|
+
((out) = (in1) + (in2), \
|
|
561
|
+
/* coverity[INTEGER_OVERFLOW] */ 1)))
|
|
562
|
+
|
|
563
|
+
#define WC_SAFE_SUB_SIGNED_CLIP(type, in1, in2, out) \
|
|
564
|
+
((((in1) > 0) && ((in2) < 0)) ? \
|
|
565
|
+
((in2) >= (in1) - WC_MAX_SINT_OF(type) ? \
|
|
566
|
+
((out) = (in1) - (in2), \
|
|
567
|
+
/* coverity[INTEGER_OVERFLOW] */ 1) : \
|
|
568
|
+
((out) = (type)WC_MAX_SINT_OF(type), 0)) \
|
|
569
|
+
: \
|
|
570
|
+
((((in1) < 0) && ((in2) > 0)) ? \
|
|
571
|
+
((in2) <= (in1) - WC_MIN_SINT_OF(type) ? \
|
|
572
|
+
((out) = (in1) - (in2), \
|
|
573
|
+
/* coverity[INTEGER_OVERFLOW] */ 1) : \
|
|
574
|
+
((out) = (type)WC_MIN_SINT_OF(type), 0)) \
|
|
575
|
+
: \
|
|
576
|
+
((out) = (in1) - (in2), \
|
|
577
|
+
/* coverity[INTEGER_OVERFLOW] */ 1)))
|
|
578
|
+
|
|
579
|
+
#define WC_SAFE_SUM_SIGNED(type, in1, in2, out) WC_WUR_INT( \
|
|
580
|
+
((((in1) > 0) && ((in2) > 0)) ? \
|
|
581
|
+
((in2) <= WC_MAX_SINT_OF(type) - (in1) ? \
|
|
582
|
+
((out) = (in1) + (in2), \
|
|
583
|
+
/* coverity[INTEGER_OVERFLOW] */ 1) : \
|
|
584
|
+
0) \
|
|
585
|
+
: \
|
|
586
|
+
((((in1) < 0) && ((in2) < 0)) ? \
|
|
587
|
+
((in2) >= WC_MIN_SINT_OF(type) - (in1) ? \
|
|
588
|
+
((out) = (in1) + (in2), \
|
|
589
|
+
/* coverity[INTEGER_OVERFLOW] */ 1) : \
|
|
590
|
+
0) \
|
|
591
|
+
: \
|
|
592
|
+
((out) = (in1) + (in2), \
|
|
593
|
+
/* coverity[INTEGER_OVERFLOW] */ 1))))
|
|
594
|
+
|
|
595
|
+
#define WC_SAFE_SUB_SIGNED(type, in1, in2, out) WC_WUR_INT( \
|
|
596
|
+
((((in1) > 0) && ((in2) < 0)) ? \
|
|
597
|
+
((in2) >= (in1) - WC_MAX_SINT_OF(type) ? \
|
|
598
|
+
((out) = (in1) - (in2), \
|
|
599
|
+
/* coverity[INTEGER_OVERFLOW] */ 1) : \
|
|
600
|
+
0) \
|
|
601
|
+
: \
|
|
602
|
+
((((in1) < 0) && ((in2) > 0)) ? \
|
|
603
|
+
((in2) <= (in1) - WC_MIN_SINT_OF(type) ? \
|
|
604
|
+
((out) = (in1) - (in2), \
|
|
605
|
+
/* coverity[INTEGER_OVERFLOW] */ 1) : \
|
|
606
|
+
0) \
|
|
607
|
+
: \
|
|
608
|
+
((out) = (in1) - (in2), \
|
|
609
|
+
/* coverity[INTEGER_OVERFLOW] */ 1))))
|
|
610
|
+
|
|
611
|
+
#if defined(HAVE_IO_POOL)
|
|
612
|
+
WOLFSSL_API void* XMALLOC(size_t n, void* heap, int type);
|
|
613
|
+
WOLFSSL_API void* XREALLOC(void *p, size_t n, void* heap, int type);
|
|
614
|
+
WOLFSSL_API void XFREE(void *p, void* heap, int type);
|
|
615
|
+
#elif (defined(WOLFSSL_ASYNC_CRYPT) && defined(HAVE_INTEL_QA)) || \
|
|
616
|
+
defined(HAVE_INTEL_QA_SYNC)
|
|
617
|
+
#ifndef HAVE_INTEL_QA_SYNC
|
|
618
|
+
#include <wolfssl/wolfcrypt/port/intel/quickassist_mem.h>
|
|
619
|
+
#undef USE_WOLFSSL_MEMORY
|
|
620
|
+
#ifdef WOLFSSL_DEBUG_MEMORY
|
|
621
|
+
#define XMALLOC(s, h, t) \
|
|
622
|
+
IntelQaMalloc((s), (h), (t), __func__, __LINE__)
|
|
623
|
+
#define XFREE(p, h, t) \
|
|
624
|
+
IntelQaFree((p), (h), (t), __func__, __LINE__)
|
|
625
|
+
#define XREALLOC(p, n, h, t) \
|
|
626
|
+
IntelQaRealloc((p), (n), (h), (t), __func__, __LINE__)
|
|
627
|
+
#else
|
|
628
|
+
#define XMALLOC(s, h, t) IntelQaMalloc((s), (h), (t))
|
|
629
|
+
#define XFREE(p, h, t) IntelQaFree((p), (h), (t))
|
|
630
|
+
#define XREALLOC(p, n, h, t) IntelQaRealloc((p), (n), (h), (t))
|
|
631
|
+
#endif /* WOLFSSL_DEBUG_MEMORY */
|
|
632
|
+
#else
|
|
633
|
+
#include <wolfssl/wolfcrypt/port/intel/quickassist_sync.h>
|
|
634
|
+
#undef USE_WOLFSSL_MEMORY
|
|
635
|
+
#ifdef WOLFSSL_DEBUG_MEMORY
|
|
636
|
+
#define XMALLOC(s, h, t) \
|
|
637
|
+
wc_CryptoCb_IntelQaMalloc((s), (h), (t), __func__, __LINE__)
|
|
638
|
+
#define XFREE(p, h, t) \
|
|
639
|
+
wc_CryptoCb_IntelQaFree((p), (h), (t), __func__, __LINE__)
|
|
640
|
+
#define XREALLOC(p, n, h, t) \
|
|
641
|
+
wc_CryptoCb_IntelQaRealloc((p), (n), (h), (t), __func__, \
|
|
642
|
+
__LINE__)
|
|
643
|
+
#else
|
|
644
|
+
#define XMALLOC(s, h, t) \
|
|
645
|
+
wc_CryptoCb_IntelQaMalloc((s), (h), (t))
|
|
646
|
+
#define XFREE(p, h, t) \
|
|
647
|
+
wc_CryptoCb_IntelQaFree((p), (h), (t))
|
|
648
|
+
#define XREALLOC(p, n, h, t) \
|
|
649
|
+
wc_CryptoCb_IntelQaRealloc((p), (n), (h), (t))
|
|
650
|
+
#endif /* WOLFSSL_DEBUG_MEMORY */
|
|
651
|
+
#endif
|
|
652
|
+
#elif defined(XMALLOC_USER)
|
|
653
|
+
/* prototypes for user heap override functions */
|
|
654
|
+
#include <stddef.h> /* for size_t */
|
|
655
|
+
extern void *XMALLOC(size_t n, void* heap, int type);
|
|
656
|
+
extern void *XREALLOC(void *p, size_t n, void* heap, int type);
|
|
657
|
+
extern void XFREE(void *p, void* heap, int type);
|
|
658
|
+
#elif defined(WOLFSSL_MEMORY_LOG)
|
|
659
|
+
#define XMALLOC(n, h, t) xmalloc(n, h, t, __func__, __FILE__, __LINE__)
|
|
660
|
+
#define XREALLOC(p, n, h, t) \
|
|
661
|
+
xrealloc(p, n, h, t, __func__, __FILE__, __LINE__)
|
|
662
|
+
#define XFREE(p, h, t) xfree(p, h, t, __func__, __FILE__, __LINE__)
|
|
663
|
+
|
|
664
|
+
/* prototypes for user heap override functions */
|
|
665
|
+
#include <stddef.h> /* for size_t */
|
|
666
|
+
#include <stdlib.h>
|
|
667
|
+
WOLFSSL_API void *xmalloc(size_t n, void* heap, int type,
|
|
668
|
+
const char* func, const char* file, unsigned int line);
|
|
669
|
+
WOLFSSL_API void *xrealloc(void *p, size_t n, void* heap, int type,
|
|
670
|
+
const char* func, const char* file, unsigned int line);
|
|
671
|
+
WOLFSSL_API void xfree(void *p, void* heap, int type, const char* func,
|
|
672
|
+
const char* file, unsigned int line);
|
|
673
|
+
#elif defined(XMALLOC_OVERRIDE)
|
|
674
|
+
/* override the XMALLOC, XFREE and XREALLOC macros */
|
|
675
|
+
#elif defined(WOLFSSL_TELIT_M2MB)
|
|
676
|
+
/* Telit M2MB SDK requires use m2mb_os API's, not std malloc/free */
|
|
677
|
+
/* Use of malloc/free will cause CPU reboot */
|
|
678
|
+
#define XMALLOC(s, h, t) ((void)(h), (void)(t), \
|
|
679
|
+
m2mb_os_malloc((s)))
|
|
680
|
+
#ifdef WOLFSSL_XFREE_NO_NULLNESS_CHECK
|
|
681
|
+
#define XFREE(p, h, t) m2mb_os_free(xp)
|
|
682
|
+
#else
|
|
683
|
+
#define XFREE(p, h, t) do { void* xp = (p); if (xp) \
|
|
684
|
+
m2mb_os_free(xp); } while (0)
|
|
685
|
+
#endif
|
|
686
|
+
#define XREALLOC(p, n, h, t) m2mb_os_realloc((p), (n))
|
|
687
|
+
|
|
688
|
+
#elif defined(NO_WOLFSSL_MEMORY)
|
|
689
|
+
#ifdef WOLFSSL_NO_MALLOC
|
|
690
|
+
/* this platform does not support heap use */
|
|
691
|
+
#ifdef WOLFSSL_SMALL_STACK
|
|
692
|
+
#error WOLFSSL_SMALL_STACK requires a heap implementation.
|
|
693
|
+
#endif
|
|
694
|
+
#ifndef WC_NO_CONSTRUCTORS
|
|
695
|
+
#define WC_NO_CONSTRUCTORS
|
|
696
|
+
#endif
|
|
697
|
+
#ifdef WOLFSSL_MALLOC_CHECK
|
|
698
|
+
#ifndef NO_STDIO_FILESYSTEM
|
|
699
|
+
#include <stdio.h>
|
|
700
|
+
#endif
|
|
701
|
+
static inline void* malloc_check(size_t sz) {
|
|
702
|
+
fprintf(stderr, "wolfSSL_malloc failed");
|
|
703
|
+
return NULL;
|
|
704
|
+
};
|
|
705
|
+
#define XMALLOC(s, h, t) ((void)(h), (void)(t), malloc_check((s)))
|
|
706
|
+
#define XFREE(p, h, t) do { (void)(h); (void)(t); } while (0)
|
|
707
|
+
#define XREALLOC(p, n, h, t) ((void)(h), (void)(t), NULL)
|
|
708
|
+
#else
|
|
709
|
+
#define XMALLOC(s, h, t) ((void)(s), (void)(h), (void)(t), NULL)
|
|
710
|
+
#define XFREE(p, h, t) do { (void)(p); (void)(h); (void)(t); } while(0)
|
|
711
|
+
#define XREALLOC(p, n, h, t) ((void)(p), (void)(n), (void)(h), (void)(t), NULL)
|
|
712
|
+
#endif
|
|
713
|
+
#else
|
|
714
|
+
/* just use plain C stdlib stuff if desired */
|
|
715
|
+
#include <stdlib.h>
|
|
716
|
+
#define XMALLOC(s, h, t) ((void)(h), (void)(t), malloc((size_t)(s))) /* native heap */
|
|
717
|
+
#ifdef WOLFSSL_XFREE_NO_NULLNESS_CHECK
|
|
718
|
+
#define XFREE(p, h, t) do { (void)(h); (void)(t); free(p); } while (0) /* native heap */
|
|
719
|
+
#else
|
|
720
|
+
#define XFREE(p, h, t) do { void* xp = (p); (void)(h); if (xp) free(xp); } while (0) /* native heap */
|
|
721
|
+
#endif
|
|
722
|
+
#define XREALLOC(p, n, h, t) \
|
|
723
|
+
((void)(h), (void)(t), realloc((p), (size_t)(n))) /* native heap */
|
|
724
|
+
#endif
|
|
725
|
+
|
|
726
|
+
#elif defined(WOLFSSL_LINUXKM)
|
|
727
|
+
|
|
728
|
+
/* definitions are in linuxkm/linuxkm_wc_port.h */
|
|
729
|
+
|
|
730
|
+
#elif defined(WOLFSSL_BSDKM)
|
|
731
|
+
|
|
732
|
+
/* definitions are in bsdkm/bsdkm_wc_port.h */
|
|
733
|
+
|
|
734
|
+
#elif !defined(MICRIUM_MALLOC) && !defined(EBSNET) \
|
|
735
|
+
&& !defined(WOLFSSL_SAFERTOS) && !defined(FREESCALE_MQX) \
|
|
736
|
+
&& !defined(FREESCALE_KSDK_MQX) && !defined(FREESCALE_FREE_RTOS) \
|
|
737
|
+
&& !defined(WOLFSSL_LEANPSK) && !defined(WOLFSSL_uITRON4)
|
|
738
|
+
/* default C runtime, can install different routines at runtime via cbs */
|
|
739
|
+
#ifndef WOLFSSL_MEMORY_H
|
|
740
|
+
#include <wolfssl/wolfcrypt/memory.h>
|
|
741
|
+
#endif
|
|
742
|
+
#ifdef WOLFSSL_STATIC_MEMORY
|
|
743
|
+
#ifdef WOLFSSL_DEBUG_MEMORY
|
|
744
|
+
#define XMALLOC(s, h, t) \
|
|
745
|
+
wolfSSL_Malloc((s), (h), (t), __func__, __LINE__)
|
|
746
|
+
#ifdef WOLFSSL_XFREE_NO_NULLNESS_CHECK
|
|
747
|
+
#define XFREE(p, h, t) \
|
|
748
|
+
wolfSSL_Free(xp, h, t, __func__, __LINE__)
|
|
749
|
+
#else
|
|
750
|
+
#define XFREE(p, h, t) do { void* xp = (p); if (xp) \
|
|
751
|
+
wolfSSL_Free(xp, h, t, __func__, __LINE__); } while (0)
|
|
752
|
+
#endif
|
|
753
|
+
#define XREALLOC(p, n, h, t) \
|
|
754
|
+
wolfSSL_Realloc((p), (n), (h), (t), __func__, __LINE__)
|
|
755
|
+
#else
|
|
756
|
+
#define XMALLOC(s, h, t) wolfSSL_Malloc((s), (h), (t))
|
|
757
|
+
#ifdef WOLFSSL_XFREE_NO_NULLNESS_CHECK
|
|
758
|
+
#define XFREE(p, h, t) wolfSSL_Free(xp, h, t)
|
|
759
|
+
#else
|
|
760
|
+
#define XFREE(p, h, t) do { void* xp = (p); if (xp) \
|
|
761
|
+
wolfSSL_Free(xp, h, t); } while (0)
|
|
762
|
+
#endif
|
|
763
|
+
#define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n), (h), (t))
|
|
764
|
+
#endif /* WOLFSSL_DEBUG_MEMORY */
|
|
765
|
+
#elif defined(WOLFSSL_EMBOS) && !defined(XMALLOC_USER) \
|
|
766
|
+
&& !defined(NO_WOLFSSL_MEMORY) \
|
|
767
|
+
&& !defined(WOLFSSL_STATIC_MEMORY)
|
|
768
|
+
/* settings.h solve this case already. Avoid redefinition. */
|
|
769
|
+
#elif (!defined(FREERTOS) && !defined(FREERTOS_TCP)) || \
|
|
770
|
+
defined(WOLFSSL_TRACK_MEMORY)
|
|
771
|
+
#ifdef WOLFSSL_DEBUG_MEMORY
|
|
772
|
+
#define XMALLOC(s, h, t) ((void)(h), (void)(t), \
|
|
773
|
+
wolfSSL_Malloc((s), __func__, __LINE__))
|
|
774
|
+
#ifdef WOLFSSL_XFREE_NO_NULLNESS_CHECK
|
|
775
|
+
#define XFREE(p, h, t) do { (void)(h); (void)(t); \
|
|
776
|
+
wolfSSL_Free(xp, __func__, __LINE__); } while (0)
|
|
777
|
+
#else
|
|
778
|
+
#define XFREE(p, h, t) do { void* xp = (p); (void)(h); \
|
|
779
|
+
(void)(t); if (xp) wolfSSL_Free(xp, __func__, __LINE__); \
|
|
780
|
+
} while (0)
|
|
781
|
+
#endif
|
|
782
|
+
#define XREALLOC(p, n, h, t) ((void)(h), (void)(t), \
|
|
783
|
+
wolfSSL_Realloc((p), (n), __func__, __LINE__))
|
|
784
|
+
#else
|
|
785
|
+
#define XMALLOC(s, h, t) ((void)(h), (void)(t), \
|
|
786
|
+
wolfSSL_Malloc((s)))
|
|
787
|
+
#ifdef WOLFSSL_XFREE_NO_NULLNESS_CHECK
|
|
788
|
+
#define XFREE(p, h, t) do { (void)(h); (void)(t); \
|
|
789
|
+
wolfSSL_Free(p); } while (0)
|
|
790
|
+
#else
|
|
791
|
+
#define XFREE(p, h, t) do { void* xp = (p); (void)(h); \
|
|
792
|
+
(void)(t); if (xp) wolfSSL_Free(xp); } while (0)
|
|
793
|
+
#endif
|
|
794
|
+
#define XREALLOC(p, n, h, t) ((void)(h), (void)(t), \
|
|
795
|
+
wolfSSL_Realloc((p), (n)))
|
|
796
|
+
#endif /* WOLFSSL_DEBUG_MEMORY */
|
|
797
|
+
#endif /* WOLFSSL_STATIC_MEMORY */
|
|
798
|
+
#endif
|
|
799
|
+
|
|
800
|
+
#if defined(WOLFSSL_SMALL_STACK) && defined(WC_NO_CONSTRUCTORS)
|
|
801
|
+
#error WOLFSSL_SMALL_STACK requires constructors.
|
|
802
|
+
#endif
|
|
803
|
+
|
|
804
|
+
#include <wolfssl/wolfcrypt/memory.h>
|
|
805
|
+
|
|
806
|
+
/* declare/free variable handling for async and smallstack */
|
|
807
|
+
#ifndef WC_ALLOC_DO_ON_FAILURE
|
|
808
|
+
#define WC_ALLOC_DO_ON_FAILURE() WC_DO_NOTHING
|
|
809
|
+
#endif
|
|
810
|
+
|
|
811
|
+
#define WC_DECLARE_HEAP_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
|
|
812
|
+
VAR_TYPE* VAR_NAME[VAR_ITEMS] = { NULL, }; \
|
|
813
|
+
int idx##VAR_NAME = 0, inner_idx_##VAR_NAME
|
|
814
|
+
#define WC_HEAP_ARRAY_ARG(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE) \
|
|
815
|
+
VAR_TYPE* VAR_NAME[VAR_ITEMS]
|
|
816
|
+
#define WC_ALLOC_HEAP_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
|
|
817
|
+
for (idx##VAR_NAME=0; idx##VAR_NAME<(VAR_ITEMS); idx##VAR_NAME++) { \
|
|
818
|
+
(VAR_NAME)[idx##VAR_NAME] = (VAR_TYPE*)XMALLOC(VAR_SIZE, (HEAP), \
|
|
819
|
+
DYNAMIC_TYPE_TMP_BUFFER); \
|
|
820
|
+
if ((VAR_NAME)[idx##VAR_NAME] == NULL) { \
|
|
821
|
+
for (inner_idx_##VAR_NAME = 0; \
|
|
822
|
+
inner_idx_##VAR_NAME < idx##VAR_NAME; \
|
|
823
|
+
inner_idx_##VAR_NAME++) { \
|
|
824
|
+
XFREE((VAR_NAME)[inner_idx_##VAR_NAME], (HEAP), \
|
|
825
|
+
DYNAMIC_TYPE_TMP_BUFFER); \
|
|
826
|
+
(VAR_NAME)[inner_idx_##VAR_NAME] = NULL; \
|
|
827
|
+
} \
|
|
828
|
+
for (inner_idx_##VAR_NAME = idx##VAR_NAME + 1; \
|
|
829
|
+
inner_idx_##VAR_NAME < (VAR_ITEMS); \
|
|
830
|
+
inner_idx_##VAR_NAME++) { \
|
|
831
|
+
(VAR_NAME)[inner_idx_##VAR_NAME] = NULL; \
|
|
832
|
+
} \
|
|
833
|
+
idx##VAR_NAME = 0; \
|
|
834
|
+
WC_ALLOC_DO_ON_FAILURE(); \
|
|
835
|
+
break; \
|
|
836
|
+
} \
|
|
837
|
+
}
|
|
838
|
+
#define WC_CALLOC_HEAP_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
|
|
839
|
+
do { \
|
|
840
|
+
WC_ALLOC_HEAP_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP); \
|
|
841
|
+
if (idx##VAR_NAME != 0) { \
|
|
842
|
+
for (idx##VAR_NAME=0; \
|
|
843
|
+
idx##VAR_NAME<(VAR_ITEMS); \
|
|
844
|
+
idx##VAR_NAME++) { \
|
|
845
|
+
XMEMSET((VAR_NAME)[idx##VAR_NAME], 0, VAR_SIZE); \
|
|
846
|
+
} \
|
|
847
|
+
} \
|
|
848
|
+
} while (0)
|
|
849
|
+
#define WC_HEAP_ARRAY_OK(VAR_NAME) (idx##VAR_NAME != 0)
|
|
850
|
+
#define WC_FREE_HEAP_ARRAY(VAR_NAME, VAR_ITEMS, HEAP) \
|
|
851
|
+
if (WC_HEAP_ARRAY_OK(VAR_NAME)) { \
|
|
852
|
+
for (idx##VAR_NAME=0; idx##VAR_NAME<(VAR_ITEMS); idx##VAR_NAME++) { \
|
|
853
|
+
XFREE((VAR_NAME)[idx##VAR_NAME], (HEAP), DYNAMIC_TYPE_TMP_BUFFER); \
|
|
854
|
+
} \
|
|
855
|
+
idx##VAR_NAME = 0; \
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
#if defined(WOLFSSL_SMALL_STACK)
|
|
859
|
+
#define WC_DECLARE_VAR_IS_HEAP_ALLOC
|
|
860
|
+
#define WC_DECLARE_VAR(VAR_NAME, VAR_TYPE, VAR_SIZE, HEAP) \
|
|
861
|
+
VAR_TYPE* VAR_NAME = NULL
|
|
862
|
+
#define WC_VAR_OK(VAR_NAME) ((VAR_NAME) != NULL)
|
|
863
|
+
#define WC_ALLOC_VAR(VAR_NAME, VAR_TYPE, VAR_SIZE, HEAP) \
|
|
864
|
+
do { \
|
|
865
|
+
(VAR_NAME) = (VAR_TYPE*)XMALLOC(sizeof(VAR_TYPE) * (VAR_SIZE), \
|
|
866
|
+
(HEAP), DYNAMIC_TYPE_WOLF_BIGINT); \
|
|
867
|
+
if ((VAR_NAME) == NULL) { \
|
|
868
|
+
WC_ALLOC_DO_ON_FAILURE(); \
|
|
869
|
+
} \
|
|
870
|
+
} while (0)
|
|
871
|
+
#define WC_ALLOC_VAR_EX(VAR_NAME, VAR_TYPE, VAR_SIZE, HEAP, TY, ONFAIL)\
|
|
872
|
+
do { \
|
|
873
|
+
(VAR_NAME) = (VAR_TYPE*)XMALLOC(sizeof(VAR_TYPE) * (VAR_SIZE), \
|
|
874
|
+
(HEAP), TY); \
|
|
875
|
+
if ((VAR_NAME) == NULL) { \
|
|
876
|
+
ONFAIL; \
|
|
877
|
+
} \
|
|
878
|
+
} while (0)
|
|
879
|
+
#define WC_CALLOC_VAR(VAR_NAME, VAR_TYPE, VAR_SIZE, HEAP) \
|
|
880
|
+
do { \
|
|
881
|
+
WC_ALLOC_VAR(VAR_NAME, VAR_TYPE, VAR_SIZE, HEAP); \
|
|
882
|
+
XMEMSET(VAR_NAME, 0, sizeof(VAR_TYPE) * (VAR_SIZE)); \
|
|
883
|
+
} while (0)
|
|
884
|
+
#define WC_FREE_VAR(VAR_NAME, HEAP) \
|
|
885
|
+
XFREE(VAR_NAME, (HEAP), DYNAMIC_TYPE_WOLF_BIGINT)
|
|
886
|
+
#define WC_FREE_VAR_EX(VAR_NAME, HEAP, TYPE) \
|
|
887
|
+
XFREE(VAR_NAME, (HEAP), TYPE)
|
|
888
|
+
#define WC_DECLARE_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
|
|
889
|
+
WC_DECLARE_HEAP_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP)
|
|
890
|
+
#define WC_ARRAY_ARG(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE) \
|
|
891
|
+
WC_HEAP_ARRAY_ARG(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE)
|
|
892
|
+
#define WC_ALLOC_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
|
|
893
|
+
WC_ALLOC_HEAP_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP)
|
|
894
|
+
#define WC_CALLOC_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
|
|
895
|
+
WC_CALLOC_HEAP_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP)
|
|
896
|
+
#define WC_ARRAY_OK(VAR_NAME) WC_HEAP_ARRAY_OK(VAR_NAME)
|
|
897
|
+
#define WC_FREE_ARRAY(VAR_NAME, VAR_ITEMS, HEAP) \
|
|
898
|
+
WC_FREE_HEAP_ARRAY(VAR_NAME, VAR_ITEMS, HEAP)
|
|
899
|
+
#else
|
|
900
|
+
#undef WC_DECLARE_VAR_IS_HEAP_ALLOC
|
|
901
|
+
#define WC_DECLARE_VAR(VAR_NAME, VAR_TYPE, VAR_SIZE, HEAP) \
|
|
902
|
+
VAR_TYPE VAR_NAME[VAR_SIZE]
|
|
903
|
+
#define WC_ALLOC_VAR(VAR_NAME, VAR_TYPE, VAR_SIZE, HEAP) WC_DO_NOTHING
|
|
904
|
+
#define WC_ALLOC_VAR_EX(VAR_NAME, VAR_TYPE, VAR_SIZE, HEAP, TYPE, ONFAIL)\
|
|
905
|
+
WC_DO_NOTHING
|
|
906
|
+
#define WC_VAR_OK(VAR_NAME) 1
|
|
907
|
+
#define WC_CALLOC_VAR(VAR_NAME, VAR_TYPE, VAR_SIZE, HEAP) \
|
|
908
|
+
XMEMSET(VAR_NAME, 0, sizeof(var))
|
|
909
|
+
#define WC_FREE_VAR(VAR_NAME, HEAP) WC_DO_NOTHING \
|
|
910
|
+
/* nothing to free, its stack */
|
|
911
|
+
#define WC_FREE_VAR_EX(VAR_NAME, HEAP, TYPE) WC_DO_NOTHING
|
|
912
|
+
#define WC_DECLARE_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
|
|
913
|
+
VAR_TYPE VAR_NAME[VAR_ITEMS][(VAR_SIZE) / sizeof(VAR_TYPE)] /* NOLINT(bugprone-sizeof-expression) */
|
|
914
|
+
#define WC_ARRAY_ARG(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE) \
|
|
915
|
+
VAR_TYPE VAR_NAME[VAR_ITEMS][(VAR_SIZE) / sizeof(VAR_TYPE)] /* NOLINT(bugprone-sizeof-expression) */
|
|
916
|
+
#define WC_ALLOC_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
|
|
917
|
+
WC_DO_NOTHING
|
|
918
|
+
#define WC_CALLOC_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
|
|
919
|
+
XMEMSET(VAR_NAME, 0, sizeof(VAR_NAME))
|
|
920
|
+
#define WC_ARRAY_OK(VAR_NAME) 1
|
|
921
|
+
#define WC_FREE_ARRAY(VAR_NAME, VAR_ITEMS, HEAP) WC_DO_NOTHING \
|
|
922
|
+
/* nothing to free, its stack */
|
|
923
|
+
#endif
|
|
924
|
+
|
|
925
|
+
#if defined(HAVE_FIPS) || defined(HAVE_SELFTEST)
|
|
926
|
+
/* These are here for the FIPS code that can't be changed.
|
|
927
|
+
* New definitions don't need to be added here. */
|
|
928
|
+
#define DECLARE_VAR WC_DECLARE_VAR
|
|
929
|
+
#define DECLARE_ARRAY WC_DECLARE_ARRAY
|
|
930
|
+
#define FREE_VAR WC_FREE_VAR
|
|
931
|
+
#define FREE_ARRAY WC_FREE_ARRAY
|
|
932
|
+
#define DECLARE_ARRAY_DYNAMIC_DEC WC_DECLARE_HEAP_ARRAY
|
|
933
|
+
#define DECLARE_ARRAY_DYNAMIC_EXE WC_ALLOC_HEAP_ARRAY
|
|
934
|
+
#define FREE_ARRAY_DYNAMIC WC_FREE_HEAP_ARRAY
|
|
935
|
+
#endif /* HAVE_FIPS */
|
|
936
|
+
|
|
937
|
+
#if !defined(USE_WOLF_STRTOK) && \
|
|
938
|
+
((defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) || \
|
|
939
|
+
defined(WOLFSSL_TIRTOS) || defined(WOLF_C99))
|
|
940
|
+
#define USE_WOLF_STRTOK
|
|
941
|
+
#endif
|
|
942
|
+
#if !defined(USE_WOLF_STRSEP) && (defined(WOLF_C89) || defined(WOLF_C99))
|
|
943
|
+
#define USE_WOLF_STRSEP
|
|
944
|
+
#endif
|
|
945
|
+
#if !defined(XSTRLCPY) && !defined(USE_WOLF_STRLCPY)
|
|
946
|
+
#define USE_WOLF_STRLCPY
|
|
947
|
+
#endif
|
|
948
|
+
#if !defined(XSTRLCAT) && !defined(USE_WOLF_STRLCAT)
|
|
949
|
+
#define USE_WOLF_STRLCAT
|
|
950
|
+
#endif
|
|
951
|
+
|
|
952
|
+
#ifndef STRING_USER
|
|
953
|
+
#ifndef NO_STRING_H
|
|
954
|
+
#include <string.h>
|
|
955
|
+
#endif
|
|
956
|
+
|
|
957
|
+
#define XMEMCPY(d,s,l) memcpy((d),(s),(l))
|
|
958
|
+
#define XMEMSET(b,c,l) memset((b),(c),(l))
|
|
959
|
+
#define XMEMCMP(s1,s2,n) memcmp((s1),(s2),(n))
|
|
960
|
+
#define XMEMMOVE(d,s,l) memmove((d),(s),(l))
|
|
961
|
+
|
|
962
|
+
#define XSTRLEN(s1) strlen((s1))
|
|
963
|
+
#define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n))
|
|
964
|
+
/* strstr, strncmp, strcmp, and strncat only used by wolfSSL proper,
|
|
965
|
+
* not required for wolfCrypt only */
|
|
966
|
+
#define XSTRSTR(s1,s2) strstr((s1),(s2))
|
|
967
|
+
#define XSTRNSTR(s1,s2,n) wolfSSL_strnstr((s1),(s2),(n))
|
|
968
|
+
#define XSTRNCMP(s1,s2,n) strncmp((s1),(s2),(n))
|
|
969
|
+
#define XSTRCMP(s1,s2) strcmp((s1),(s2))
|
|
970
|
+
#define XSTRNCAT(s1,s2,n) strncat((s1),(s2),(n))
|
|
971
|
+
|
|
972
|
+
#ifdef USE_WOLF_STRSEP
|
|
973
|
+
#define XSTRSEP(s1,d) wc_strsep((s1),(d))
|
|
974
|
+
#else
|
|
975
|
+
#define XSTRSEP(s1,d) strsep((s1),(d))
|
|
976
|
+
#endif
|
|
977
|
+
|
|
978
|
+
#ifndef XSTRCASECMP
|
|
979
|
+
#if (defined(MICROCHIP_MPLAB_HARMONY) || defined(MICROCHIP_PIC32)) && \
|
|
980
|
+
(__XC32_VERSION >= 1000) && (__XC32_VERSION < 4000)
|
|
981
|
+
/* XC32 supports str[n]casecmp in version >= 1.0 through 4.0. */
|
|
982
|
+
#define XSTRCASECMP(s1,s2) strcasecmp((s1),(s2))
|
|
983
|
+
#elif defined(MICROCHIP_MPLAB_HARMONY) || defined(MICROCHIP_PIC32) || \
|
|
984
|
+
defined(WOLFSSL_TIRTOS) || defined(WOLFSSL_ZEPHYR) || \
|
|
985
|
+
defined(MICROCHIP_PIC24)
|
|
986
|
+
/* XC32 version < 1.0 does not support strcasecmp. */
|
|
987
|
+
#define USE_WOLF_STRCASECMP
|
|
988
|
+
#elif defined(USE_WINDOWS_API) || defined(FREERTOS_TCP_WINSIM)
|
|
989
|
+
#define XSTRCASECMP(s1,s2) _stricmp((s1),(s2))
|
|
990
|
+
#else
|
|
991
|
+
#if defined(HAVE_STRINGS_H) && defined(WOLF_C99) && \
|
|
992
|
+
!defined(WOLFSSL_SGX)
|
|
993
|
+
#include <strings.h>
|
|
994
|
+
#endif
|
|
995
|
+
#if defined(WOLFSSL_DEOS)
|
|
996
|
+
#define XSTRCASECMP(s1,s2) stricmp((s1),(s2))
|
|
997
|
+
#elif defined(WOLFSSL_CMSIS_RTOSv2) || defined(WOLFSSL_AZSPHERE) \
|
|
998
|
+
|| defined(WOLF_C89)
|
|
999
|
+
#define USE_WOLF_STRCASECMP
|
|
1000
|
+
#elif defined(WOLF_C89)
|
|
1001
|
+
#define XSTRCASECMP(s1,s2) strcmp((s1),(s2))
|
|
1002
|
+
#else
|
|
1003
|
+
#define XSTRCASECMP(s1,s2) strcasecmp((s1),(s2))
|
|
1004
|
+
#endif
|
|
1005
|
+
#endif
|
|
1006
|
+
#ifdef USE_WOLF_STRCASECMP
|
|
1007
|
+
#undef XSTRCASECMP
|
|
1008
|
+
#define XSTRCASECMP(s1,s2) wc_strcasecmp((s1), (s2))
|
|
1009
|
+
#endif
|
|
1010
|
+
#endif /* !XSTRCASECMP */
|
|
1011
|
+
|
|
1012
|
+
#ifndef XSTRNCASECMP
|
|
1013
|
+
#if (defined(MICROCHIP_MPLAB_HARMONY) || defined(MICROCHIP_PIC32)) && \
|
|
1014
|
+
(__XC32_VERSION >= 1000)
|
|
1015
|
+
/* XC32 supports str[n]casecmp in version >= 1.0. */
|
|
1016
|
+
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
|
|
1017
|
+
#elif defined(MICROCHIP_MPLAB_HARMONY) || defined(MICROCHIP_PIC32) || \
|
|
1018
|
+
defined(WOLFSSL_TIRTOS) || defined(WOLFSSL_ZEPHYR) || \
|
|
1019
|
+
defined(MICROCHIP_PIC24)
|
|
1020
|
+
/* XC32 version < 1.0 does not support strncasecmp. */
|
|
1021
|
+
#define USE_WOLF_STRNCASECMP
|
|
1022
|
+
#elif defined(USE_WINDOWS_API) || defined(FREERTOS_TCP_WINSIM)
|
|
1023
|
+
#define XSTRNCASECMP(s1,s2,n) _strnicmp((s1),(s2),(n))
|
|
1024
|
+
#else
|
|
1025
|
+
#if defined(HAVE_STRINGS_H) && defined(WOLF_C99) && \
|
|
1026
|
+
!defined(WOLFSSL_SGX)
|
|
1027
|
+
#include <strings.h>
|
|
1028
|
+
#endif
|
|
1029
|
+
#if defined(WOLFSSL_DEOS)
|
|
1030
|
+
#define XSTRNCASECMP(s1,s2,n) strnicmp((s1),(s2),(n))
|
|
1031
|
+
#elif defined(WOLFSSL_CMSIS_RTOSv2) || defined(WOLFSSL_AZSPHERE) \
|
|
1032
|
+
|| defined(WOLF_C89)
|
|
1033
|
+
#define USE_WOLF_STRNCASECMP
|
|
1034
|
+
#elif defined(WOLF_C89)
|
|
1035
|
+
#define XSTRNCASECMP(s1,s2,n) strncmp((s1),(s2),(n))
|
|
1036
|
+
#else
|
|
1037
|
+
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
|
|
1038
|
+
#endif
|
|
1039
|
+
#endif
|
|
1040
|
+
#ifdef USE_WOLF_STRNCASECMP
|
|
1041
|
+
#undef XSTRNCASECMP
|
|
1042
|
+
#define XSTRNCASECMP(s1,s2,n) wc_strncasecmp((s1),(s2),(n))
|
|
1043
|
+
#endif
|
|
1044
|
+
#endif /* !XSTRNCASECMP */
|
|
1045
|
+
|
|
1046
|
+
/* snprintf is used in asn.c for GetTimeString, PKCS7 test, and when
|
|
1047
|
+
* debugging is turned on */
|
|
1048
|
+
#ifndef XSNPRINTF
|
|
1049
|
+
#ifndef USE_WINDOWS_API
|
|
1050
|
+
#if defined(WOLFSSL_ESPIDF) && \
|
|
1051
|
+
(!defined(NO_ASN_TIME) && defined(HAVE_PKCS7))
|
|
1052
|
+
#include <stdarg.h>
|
|
1053
|
+
/* later gcc than 7.1 introduces -Wformat-truncation */
|
|
1054
|
+
/* In cases when truncation is expected the caller needs*/
|
|
1055
|
+
/* to check the return value from the function so that */
|
|
1056
|
+
/* compiler doesn't complain. */
|
|
1057
|
+
/* xtensa-esp32-elf v8.2.0 warns truncation at */
|
|
1058
|
+
/* GetAsnTimeString() */
|
|
1059
|
+
static WC_INLINE
|
|
1060
|
+
int _xsnprintf_(char *s, size_t n, const char *format, ...)
|
|
1061
|
+
{
|
|
1062
|
+
va_list ap;
|
|
1063
|
+
int ret;
|
|
1064
|
+
|
|
1065
|
+
if ((int)n <= 0) return -1;
|
|
1066
|
+
|
|
1067
|
+
va_start(ap, format);
|
|
1068
|
+
|
|
1069
|
+
ret = XVSNPRINTF(s, n, format, ap);
|
|
1070
|
+
if (ret < 0)
|
|
1071
|
+
ret = -1;
|
|
1072
|
+
|
|
1073
|
+
va_end(ap);
|
|
1074
|
+
|
|
1075
|
+
return ret;
|
|
1076
|
+
}
|
|
1077
|
+
#define XSNPRINTF _xsnprintf_
|
|
1078
|
+
#elif defined(FREESCALE_MQX)
|
|
1079
|
+
/* see wc_port.h for fio.h and nio.h includes. MQX does not
|
|
1080
|
+
have stdio.h available, so it needs its own section. */
|
|
1081
|
+
#define XSNPRINTF snprintf
|
|
1082
|
+
#elif defined(WOLF_C89)
|
|
1083
|
+
#ifndef NO_STDIO_FILESYSTEM
|
|
1084
|
+
#include <stdio.h>
|
|
1085
|
+
#endif
|
|
1086
|
+
#define XSPRINTF sprintf
|
|
1087
|
+
/* snprintf not available for C89, so remap using macro */
|
|
1088
|
+
#ifdef WOLF_NO_VARIADIC_MACROS
|
|
1089
|
+
#error WOLF_NO_VARIADIC_MACROS requires user-supplied \
|
|
1090
|
+
binding for XSNPRINTF
|
|
1091
|
+
#else
|
|
1092
|
+
#define XSNPRINTF(f, len, ...) sprintf(f, __VA_ARGS__)
|
|
1093
|
+
#endif
|
|
1094
|
+
#else
|
|
1095
|
+
#ifndef NO_STDIO_FILESYSTEM
|
|
1096
|
+
#include <stdio.h>
|
|
1097
|
+
#endif
|
|
1098
|
+
#define XSNPRINTF snprintf
|
|
1099
|
+
#endif
|
|
1100
|
+
#else
|
|
1101
|
+
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
|
|
1102
|
+
#if defined(_MSC_VER) && (_MSC_VER >= 1900)
|
|
1103
|
+
/* Beginning with the UCRT in Visual Studio 2015 and
|
|
1104
|
+
* Windows 10, snprintf is no longer identical to
|
|
1105
|
+
* _snprintf. The snprintf function behavior is now
|
|
1106
|
+
* C99 standard compliant. */
|
|
1107
|
+
#include <stdio.h>
|
|
1108
|
+
#define XSNPRINTF snprintf
|
|
1109
|
+
#else
|
|
1110
|
+
/* 4996 warning to use MS extensions e.g., _sprintf_s
|
|
1111
|
+
* instead of _snprintf */
|
|
1112
|
+
#if !defined(__MINGW32__)
|
|
1113
|
+
#pragma warning(disable: 4996)
|
|
1114
|
+
#endif
|
|
1115
|
+
#include <stdarg.h>
|
|
1116
|
+
static WC_INLINE
|
|
1117
|
+
int xsnprintf(char *buffer, size_t bufsize,
|
|
1118
|
+
const char *format, ...) {
|
|
1119
|
+
va_list ap;
|
|
1120
|
+
int ret;
|
|
1121
|
+
|
|
1122
|
+
if ((int)bufsize <= 0) return -1;
|
|
1123
|
+
va_start(ap, format);
|
|
1124
|
+
ret = XVSNPRINTF(buffer, bufsize, format, ap);
|
|
1125
|
+
if (ret >= (int)bufsize)
|
|
1126
|
+
ret = -1;
|
|
1127
|
+
va_end(ap);
|
|
1128
|
+
return ret;
|
|
1129
|
+
}
|
|
1130
|
+
#define XSNPRINTF xsnprintf
|
|
1131
|
+
#endif /* (_MSC_VER >= 1900) */
|
|
1132
|
+
#else
|
|
1133
|
+
#define XSNPRINTF snprintf
|
|
1134
|
+
#endif /* _MSC_VER */
|
|
1135
|
+
#endif /* USE_WINDOWS_API */
|
|
1136
|
+
#endif /* !XSNPRINTF */
|
|
1137
|
+
|
|
1138
|
+
#if defined(WOLFSSL_CERT_EXT) || defined(OPENSSL_EXTRA) || \
|
|
1139
|
+
defined(HAVE_ALPN) || defined(WOLFSSL_SNIFFER) || \
|
|
1140
|
+
defined(WOLFSSL_ASN_PARSE_KEYUSAGE)
|
|
1141
|
+
/* use only Thread Safe version of strtok */
|
|
1142
|
+
#if defined(USE_WOLF_STRTOK)
|
|
1143
|
+
#define XSTRTOK(s1,d,ptr) wc_strtok((s1),(d),(ptr))
|
|
1144
|
+
#elif defined(__WATCOMC__)
|
|
1145
|
+
#if __WATCOMC__ < 1300
|
|
1146
|
+
#define USE_WOLF_STRTOK
|
|
1147
|
+
#define XSTRTOK(s1,d,ptr) wc_strtok((s1),(d),(ptr))
|
|
1148
|
+
#else
|
|
1149
|
+
#define XSTRTOK(s1,d,ptr) strtok_r((s1),(d),(ptr))
|
|
1150
|
+
#endif
|
|
1151
|
+
#elif defined(USE_WINDOWS_API) || defined(INTIME_RTOS)
|
|
1152
|
+
#define XSTRTOK(s1,d,ptr) strtok_s((s1),(d),(ptr))
|
|
1153
|
+
#else
|
|
1154
|
+
#define XSTRTOK(s1,d,ptr) strtok_r((s1),(d),(ptr))
|
|
1155
|
+
#endif
|
|
1156
|
+
#endif
|
|
1157
|
+
|
|
1158
|
+
#if defined(WOLFSSL_CERT_EXT) || defined(HAVE_OCSP) || \
|
|
1159
|
+
defined(HAVE_CRL_IO) || defined(HAVE_HTTP_CLIENT) || \
|
|
1160
|
+
!defined(NO_CRYPT_BENCHMARK) || defined(OPENSSL_EXTRA)
|
|
1161
|
+
|
|
1162
|
+
#ifndef XATOI /* if custom XATOI is not already defined */
|
|
1163
|
+
#include <stdlib.h>
|
|
1164
|
+
#define XATOI(s) atoi((s))
|
|
1165
|
+
#endif
|
|
1166
|
+
#endif
|
|
1167
|
+
#endif /* STRING_USER */
|
|
1168
|
+
|
|
1169
|
+
#ifdef USE_WOLF_STRTOK
|
|
1170
|
+
WOLFSSL_API char* wc_strtok(char *str, const char *delim, char **nextp);
|
|
1171
|
+
#endif
|
|
1172
|
+
#ifdef USE_WOLF_STRSEP
|
|
1173
|
+
WOLFSSL_API char* wc_strsep(char **stringp, const char *delim);
|
|
1174
|
+
#endif
|
|
1175
|
+
|
|
1176
|
+
#ifdef USE_WOLF_STRLCPY
|
|
1177
|
+
WOLFSSL_API size_t wc_strlcpy(char *dst, const char *src, size_t dstSize);
|
|
1178
|
+
#define XSTRLCPY(s1,s2,n) wc_strlcpy((s1),(s2),(n))
|
|
1179
|
+
#endif
|
|
1180
|
+
#ifdef USE_WOLF_STRLCAT
|
|
1181
|
+
WOLFSSL_API size_t wc_strlcat(char *dst, const char *src, size_t dstSize);
|
|
1182
|
+
#define XSTRLCAT(s1,s2,n) wc_strlcat((s1),(s2),(n))
|
|
1183
|
+
#endif
|
|
1184
|
+
#ifdef USE_WOLF_STRCASECMP
|
|
1185
|
+
WOLFSSL_API int wc_strcasecmp(const char *s1, const char *s2);
|
|
1186
|
+
#endif
|
|
1187
|
+
#ifdef USE_WOLF_STRNCASECMP
|
|
1188
|
+
WOLFSSL_API int wc_strncasecmp(const char *s1, const char *s2, size_t n);
|
|
1189
|
+
#endif
|
|
1190
|
+
|
|
1191
|
+
#if !defined(XSTRDUP) && !defined(USE_WOLF_STRDUP)
|
|
1192
|
+
#define USE_WOLF_STRDUP
|
|
1193
|
+
#endif
|
|
1194
|
+
#ifdef USE_WOLF_STRDUP
|
|
1195
|
+
WOLFSSL_LOCAL char* wc_strdup_ex(const char *src, int memType);
|
|
1196
|
+
#define wc_strdup(src) wc_strdup_ex(src, DYNAMIC_TYPE_TMP_BUFFER)
|
|
1197
|
+
#define XSTRDUP(src) wc_strdup(src)
|
|
1198
|
+
#endif
|
|
1199
|
+
|
|
1200
|
+
#if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
|
|
1201
|
+
#ifndef XGETENV
|
|
1202
|
+
#ifdef NO_GETENV
|
|
1203
|
+
#define XGETENV(x) (NULL)
|
|
1204
|
+
#else
|
|
1205
|
+
#include <stdlib.h>
|
|
1206
|
+
#define XGETENV getenv
|
|
1207
|
+
#endif
|
|
1208
|
+
#endif
|
|
1209
|
+
#endif /* !NO_FILESYSTEM && !NO_STDIO_FILESYSTEM */
|
|
1210
|
+
|
|
1211
|
+
#ifndef CTYPE_USER
|
|
1212
|
+
#ifndef NO_CTYPE_H
|
|
1213
|
+
#include <ctype.h>
|
|
1214
|
+
#endif
|
|
1215
|
+
#if defined(HAVE_ECC) || defined(HAVE_OCSP) || \
|
|
1216
|
+
defined(WOLFSSL_KEY_GEN) || !defined(NO_DSA) || \
|
|
1217
|
+
defined(OPENSSL_EXTRA)
|
|
1218
|
+
#define XTOUPPER(c) toupper((c))
|
|
1219
|
+
#endif
|
|
1220
|
+
#if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
|
|
1221
|
+
#define XISALNUM(c) isalnum((c))
|
|
1222
|
+
#if !defined(HAVE_ISASCII) || defined(NO_STDLIB_ISASCII)
|
|
1223
|
+
#define XISASCII(c) (((c) >= 0 && (c) <= 127) ? 1 : 0)
|
|
1224
|
+
#else
|
|
1225
|
+
#define XISASCII(c) isascii((c))
|
|
1226
|
+
#endif
|
|
1227
|
+
#define XISSPACE(c) isspace((c))
|
|
1228
|
+
#endif
|
|
1229
|
+
/* needed by wolfSSL_check_domain_name() */
|
|
1230
|
+
#define XTOLOWER(c) tolower((c))
|
|
1231
|
+
#endif
|
|
1232
|
+
|
|
1233
|
+
#ifndef WC_OFFSETOF
|
|
1234
|
+
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 4))
|
|
1235
|
+
#define WC_OFFSETOF(type, field) __builtin_offsetof(type, field)
|
|
1236
|
+
#elif defined(__WATCOMC__)
|
|
1237
|
+
#include <stddef.h>
|
|
1238
|
+
#define WC_OFFSETOF offsetof
|
|
1239
|
+
#else
|
|
1240
|
+
#define WC_OFFSETOF(type, field) ((size_t)&(((type *)0)->field))
|
|
1241
|
+
#endif
|
|
1242
|
+
#endif
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
/* memory allocation types for user hints */
|
|
1246
|
+
enum {
|
|
1247
|
+
DYNAMIC_TYPE_CA = 1,
|
|
1248
|
+
DYNAMIC_TYPE_CERT = 2,
|
|
1249
|
+
DYNAMIC_TYPE_KEY = 3,
|
|
1250
|
+
DYNAMIC_TYPE_FILE = 4,
|
|
1251
|
+
DYNAMIC_TYPE_SUBJECT_CN = 5,
|
|
1252
|
+
DYNAMIC_TYPE_PUBLIC_KEY = 6,
|
|
1253
|
+
DYNAMIC_TYPE_SIGNER = 7,
|
|
1254
|
+
DYNAMIC_TYPE_NONE = 8,
|
|
1255
|
+
DYNAMIC_TYPE_BIGINT = 9,
|
|
1256
|
+
DYNAMIC_TYPE_RSA = 10,
|
|
1257
|
+
DYNAMIC_TYPE_METHOD = 11,
|
|
1258
|
+
DYNAMIC_TYPE_OUT_BUFFER = 12,
|
|
1259
|
+
DYNAMIC_TYPE_IN_BUFFER = 13,
|
|
1260
|
+
DYNAMIC_TYPE_INFO = 14,
|
|
1261
|
+
DYNAMIC_TYPE_DH = 15,
|
|
1262
|
+
DYNAMIC_TYPE_DOMAIN = 16,
|
|
1263
|
+
DYNAMIC_TYPE_SSL = 17,
|
|
1264
|
+
DYNAMIC_TYPE_CTX = 18,
|
|
1265
|
+
DYNAMIC_TYPE_WRITEV = 19,
|
|
1266
|
+
DYNAMIC_TYPE_OPENSSL = 20,
|
|
1267
|
+
DYNAMIC_TYPE_DSA = 21,
|
|
1268
|
+
DYNAMIC_TYPE_CRL = 22,
|
|
1269
|
+
DYNAMIC_TYPE_REVOKED = 23,
|
|
1270
|
+
DYNAMIC_TYPE_CRL_ENTRY = 24,
|
|
1271
|
+
DYNAMIC_TYPE_CERT_MANAGER = 25,
|
|
1272
|
+
DYNAMIC_TYPE_CRL_MONITOR = 26,
|
|
1273
|
+
DYNAMIC_TYPE_OCSP_STATUS = 27,
|
|
1274
|
+
DYNAMIC_TYPE_OCSP_ENTRY = 28,
|
|
1275
|
+
DYNAMIC_TYPE_ALTNAME = 29,
|
|
1276
|
+
DYNAMIC_TYPE_SUITES = 30,
|
|
1277
|
+
DYNAMIC_TYPE_CIPHER = 31,
|
|
1278
|
+
DYNAMIC_TYPE_RNG = 32,
|
|
1279
|
+
DYNAMIC_TYPE_ARRAYS = 33,
|
|
1280
|
+
DYNAMIC_TYPE_DTLS_POOL = 34,
|
|
1281
|
+
DYNAMIC_TYPE_SOCKADDR = 35,
|
|
1282
|
+
DYNAMIC_TYPE_LIBZ = 36,
|
|
1283
|
+
DYNAMIC_TYPE_ECC = 37,
|
|
1284
|
+
DYNAMIC_TYPE_TMP_BUFFER = 38,
|
|
1285
|
+
DYNAMIC_TYPE_DTLS_MSG = 39,
|
|
1286
|
+
DYNAMIC_TYPE_X509 = 40,
|
|
1287
|
+
DYNAMIC_TYPE_TLSX = 41,
|
|
1288
|
+
DYNAMIC_TYPE_OCSP = 42,
|
|
1289
|
+
DYNAMIC_TYPE_SIGNATURE = 43,
|
|
1290
|
+
DYNAMIC_TYPE_HASHES = 44,
|
|
1291
|
+
DYNAMIC_TYPE_SRP = 45,
|
|
1292
|
+
DYNAMIC_TYPE_COOKIE_PWD = 46,
|
|
1293
|
+
DYNAMIC_TYPE_USER_CRYPTO = 47,
|
|
1294
|
+
DYNAMIC_TYPE_OCSP_REQUEST = 48,
|
|
1295
|
+
DYNAMIC_TYPE_X509_EXT = 49,
|
|
1296
|
+
DYNAMIC_TYPE_X509_STORE = 50,
|
|
1297
|
+
DYNAMIC_TYPE_X509_CTX = 51,
|
|
1298
|
+
DYNAMIC_TYPE_URL = 52,
|
|
1299
|
+
DYNAMIC_TYPE_DTLS_FRAG = 53,
|
|
1300
|
+
DYNAMIC_TYPE_DTLS_BUFFER = 54,
|
|
1301
|
+
DYNAMIC_TYPE_SESSION_TICK = 55,
|
|
1302
|
+
DYNAMIC_TYPE_PKCS = 56,
|
|
1303
|
+
DYNAMIC_TYPE_MUTEX = 57,
|
|
1304
|
+
DYNAMIC_TYPE_PKCS7 = 58,
|
|
1305
|
+
DYNAMIC_TYPE_AES_BUFFER = 59,
|
|
1306
|
+
DYNAMIC_TYPE_WOLF_BIGINT = 60,
|
|
1307
|
+
DYNAMIC_TYPE_ASN1 = 61,
|
|
1308
|
+
DYNAMIC_TYPE_LOG = 62,
|
|
1309
|
+
DYNAMIC_TYPE_WRITEDUP = 63,
|
|
1310
|
+
DYNAMIC_TYPE_PRIVATE_KEY = 64,
|
|
1311
|
+
DYNAMIC_TYPE_HMAC = 65,
|
|
1312
|
+
DYNAMIC_TYPE_ASYNC = 66,
|
|
1313
|
+
DYNAMIC_TYPE_ASYNC_NUMA = 67,
|
|
1314
|
+
DYNAMIC_TYPE_ASYNC_NUMA64 = 68,
|
|
1315
|
+
DYNAMIC_TYPE_CURVE25519 = 69,
|
|
1316
|
+
DYNAMIC_TYPE_ED25519 = 70,
|
|
1317
|
+
DYNAMIC_TYPE_SECRET = 71,
|
|
1318
|
+
DYNAMIC_TYPE_DIGEST = 72,
|
|
1319
|
+
DYNAMIC_TYPE_RSA_BUFFER = 73,
|
|
1320
|
+
DYNAMIC_TYPE_DCERT = 74,
|
|
1321
|
+
DYNAMIC_TYPE_STRING = 75,
|
|
1322
|
+
DYNAMIC_TYPE_PEM = 76,
|
|
1323
|
+
DYNAMIC_TYPE_DER = 77,
|
|
1324
|
+
DYNAMIC_TYPE_CERT_EXT = 78,
|
|
1325
|
+
DYNAMIC_TYPE_ALPN = 79,
|
|
1326
|
+
DYNAMIC_TYPE_ENCRYPTEDINFO= 80,
|
|
1327
|
+
DYNAMIC_TYPE_DIRCTX = 81,
|
|
1328
|
+
DYNAMIC_TYPE_HASHCTX = 82,
|
|
1329
|
+
DYNAMIC_TYPE_SEED = 83,
|
|
1330
|
+
DYNAMIC_TYPE_SYMMETRIC_KEY= 84,
|
|
1331
|
+
DYNAMIC_TYPE_ECC_BUFFER = 85,
|
|
1332
|
+
DYNAMIC_TYPE_SALT = 87,
|
|
1333
|
+
DYNAMIC_TYPE_HASH_TMP = 88,
|
|
1334
|
+
DYNAMIC_TYPE_BLOB = 89,
|
|
1335
|
+
DYNAMIC_TYPE_NAME_ENTRY = 90,
|
|
1336
|
+
DYNAMIC_TYPE_CURVE448 = 91,
|
|
1337
|
+
DYNAMIC_TYPE_ED448 = 92,
|
|
1338
|
+
DYNAMIC_TYPE_AES = 93,
|
|
1339
|
+
DYNAMIC_TYPE_CMAC = 94,
|
|
1340
|
+
DYNAMIC_TYPE_FALCON = 95,
|
|
1341
|
+
DYNAMIC_TYPE_SESSION = 96,
|
|
1342
|
+
DYNAMIC_TYPE_DILITHIUM = 97,
|
|
1343
|
+
DYNAMIC_TYPE_SPHINCS = 98,
|
|
1344
|
+
DYNAMIC_TYPE_SM4_BUFFER = 99,
|
|
1345
|
+
DYNAMIC_TYPE_DEBUG_TAG = 100,
|
|
1346
|
+
DYNAMIC_TYPE_LMS = 101,
|
|
1347
|
+
DYNAMIC_TYPE_BIO = 102,
|
|
1348
|
+
DYNAMIC_TYPE_X509_ACERT = 103,
|
|
1349
|
+
DYNAMIC_TYPE_OS_BUF = 104,
|
|
1350
|
+
DYNAMIC_TYPE_ASCON = 105,
|
|
1351
|
+
DYNAMIC_TYPE_SNIFFER_SERVER = 1000,
|
|
1352
|
+
DYNAMIC_TYPE_SNIFFER_SESSION = 1001,
|
|
1353
|
+
DYNAMIC_TYPE_SNIFFER_PB = 1002,
|
|
1354
|
+
DYNAMIC_TYPE_SNIFFER_PB_BUFFER = 1003,
|
|
1355
|
+
DYNAMIC_TYPE_SNIFFER_TICKET_ID = 1004,
|
|
1356
|
+
DYNAMIC_TYPE_SNIFFER_NAMED_KEY = 1005,
|
|
1357
|
+
DYNAMIC_TYPE_SNIFFER_KEY = 1006,
|
|
1358
|
+
DYNAMIC_TYPE_SNIFFER_KEYLOG_NODE = 1007,
|
|
1359
|
+
DYNAMIC_TYPE_SNIFFER_CHAIN_BUFFER = 1008,
|
|
1360
|
+
DYNAMIC_TYPE_AES_EAX = 1009
|
|
1361
|
+
};
|
|
1362
|
+
|
|
1363
|
+
/* max error buffer string size */
|
|
1364
|
+
#ifdef WOLFSSL_MAX_ERROR_SZ
|
|
1365
|
+
#if WOLFSSL_MAX_ERROR_SZ < 64
|
|
1366
|
+
/* If too small, the error_test() will fail.
|
|
1367
|
+
* See fixed length strings returned in wc_GetErrorString() */
|
|
1368
|
+
#error WOLFSSL_MAX_ERROR_SZ must be at least length of longest message
|
|
1369
|
+
#endif
|
|
1370
|
+
#else
|
|
1371
|
+
#define WOLFSSL_MAX_ERROR_SZ 80
|
|
1372
|
+
#endif
|
|
1373
|
+
|
|
1374
|
+
/* stack protection */
|
|
1375
|
+
enum {
|
|
1376
|
+
MIN_STACK_BUFFER = 8
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
/* Algorithm Types */
|
|
1381
|
+
enum wc_AlgoType {
|
|
1382
|
+
WC_ALGO_TYPE_NONE = 0,
|
|
1383
|
+
WC_ALGO_TYPE_HASH = 1,
|
|
1384
|
+
WC_ALGO_TYPE_CIPHER = 2,
|
|
1385
|
+
WC_ALGO_TYPE_PK = 3,
|
|
1386
|
+
WC_ALGO_TYPE_RNG = 4,
|
|
1387
|
+
WC_ALGO_TYPE_SEED = 5,
|
|
1388
|
+
WC_ALGO_TYPE_HMAC = 6,
|
|
1389
|
+
WC_ALGO_TYPE_CMAC = 7,
|
|
1390
|
+
WC_ALGO_TYPE_CERT = 8,
|
|
1391
|
+
WC_ALGO_TYPE_KDF = 9,
|
|
1392
|
+
WC_ALGO_TYPE_COPY = 10,
|
|
1393
|
+
WC_ALGO_TYPE_FREE = 11,
|
|
1394
|
+
WC_ALGO_TYPE_MAX = WC_ALGO_TYPE_FREE
|
|
1395
|
+
};
|
|
1396
|
+
|
|
1397
|
+
/* KDF types */
|
|
1398
|
+
enum wc_KdfType {
|
|
1399
|
+
WC_KDF_TYPE_NONE = 0,
|
|
1400
|
+
WC_KDF_TYPE_HKDF = 1,
|
|
1401
|
+
WC_KDF_TYPE_TWOSTEP_CMAC = 2 /* NIST SP 800-56C two-step cmac kdf. */
|
|
1402
|
+
/* Future: WC_KDF_TYPE_PBKDF2 = 3, WC_KDF_TYPE_SCRYPT = 4, etc. */
|
|
1403
|
+
};
|
|
1404
|
+
|
|
1405
|
+
/* hash types */
|
|
1406
|
+
enum wc_HashType {
|
|
1407
|
+
#if defined(HAVE_SELFTEST) || (defined(HAVE_FIPS) && \
|
|
1408
|
+
((! defined(HAVE_FIPS_VERSION)) || \
|
|
1409
|
+
defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION <= 2)))
|
|
1410
|
+
/* In selftest build, WC_* types are not mapped to WC_HASH_TYPE types.
|
|
1411
|
+
* Values here are based on old selftest hmac.h enum, with additions.
|
|
1412
|
+
* These values are fixed for backwards FIPS compatibility */
|
|
1413
|
+
WC_HASH_TYPE_NONE = 15,
|
|
1414
|
+
WC_HASH_TYPE_MD2 = 16,
|
|
1415
|
+
WC_HASH_TYPE_MD4 = 17,
|
|
1416
|
+
WC_HASH_TYPE_MD5 = 0,
|
|
1417
|
+
WC_HASH_TYPE_SHA = 1, /* SHA-1 (not old SHA-0) */
|
|
1418
|
+
WC_HASH_TYPE_SHA224 = 8,
|
|
1419
|
+
WC_HASH_TYPE_SHA256 = 2,
|
|
1420
|
+
WC_HASH_TYPE_SHA384 = 5,
|
|
1421
|
+
WC_HASH_TYPE_SHA512 = 4,
|
|
1422
|
+
WC_HASH_TYPE_MD5_SHA = 18,
|
|
1423
|
+
WC_HASH_TYPE_SHA3_224 = 10,
|
|
1424
|
+
WC_HASH_TYPE_SHA3_256 = 11,
|
|
1425
|
+
WC_HASH_TYPE_SHA3_384 = 12,
|
|
1426
|
+
WC_HASH_TYPE_SHA3_512 = 13,
|
|
1427
|
+
WC_HASH_TYPE_BLAKE2B = 14,
|
|
1428
|
+
WC_HASH_TYPE_BLAKE2S = 19,
|
|
1429
|
+
WC_HASH_TYPE_MAX = WC_HASH_TYPE_BLAKE2S,
|
|
1430
|
+
#ifndef WOLFSSL_NOSHA512_224
|
|
1431
|
+
#define WOLFSSL_NOSHA512_224
|
|
1432
|
+
#endif
|
|
1433
|
+
#ifndef WOLFSSL_NOSHA512_256
|
|
1434
|
+
#define WOLFSSL_NOSHA512_256
|
|
1435
|
+
#endif
|
|
1436
|
+
#else
|
|
1437
|
+
WC_HASH_TYPE_NONE = 0,
|
|
1438
|
+
WC_HASH_TYPE_MD2 = 1,
|
|
1439
|
+
WC_HASH_TYPE_MD4 = 2,
|
|
1440
|
+
WC_HASH_TYPE_MD5 = 3,
|
|
1441
|
+
WC_HASH_TYPE_SHA = 4, /* SHA-1 (not old SHA-0) */
|
|
1442
|
+
WC_HASH_TYPE_SHA224 = 5,
|
|
1443
|
+
WC_HASH_TYPE_SHA256 = 6,
|
|
1444
|
+
WC_HASH_TYPE_SHA384 = 7,
|
|
1445
|
+
WC_HASH_TYPE_SHA512 = 8,
|
|
1446
|
+
WC_HASH_TYPE_MD5_SHA = 9,
|
|
1447
|
+
WC_HASH_TYPE_SHA3_224 = 10,
|
|
1448
|
+
WC_HASH_TYPE_SHA3_256 = 11,
|
|
1449
|
+
WC_HASH_TYPE_SHA3_384 = 12,
|
|
1450
|
+
WC_HASH_TYPE_SHA3_512 = 13,
|
|
1451
|
+
WC_HASH_TYPE_BLAKE2B = 14,
|
|
1452
|
+
WC_HASH_TYPE_BLAKE2S = 15,
|
|
1453
|
+
#define _WC_HASH_TYPE_MAX WC_HASH_TYPE_BLAKE2S
|
|
1454
|
+
#ifndef WOLFSSL_NOSHA512_224
|
|
1455
|
+
WC_HASH_TYPE_SHA512_224 = 16,
|
|
1456
|
+
#undef _WC_HASH_TYPE_MAX
|
|
1457
|
+
#define _WC_HASH_TYPE_MAX WC_HASH_TYPE_SHA512_224
|
|
1458
|
+
#endif
|
|
1459
|
+
#ifndef WOLFSSL_NOSHA512_256
|
|
1460
|
+
WC_HASH_TYPE_SHA512_256 = 17,
|
|
1461
|
+
#undef _WC_HASH_TYPE_MAX
|
|
1462
|
+
#define _WC_HASH_TYPE_MAX WC_HASH_TYPE_SHA512_256
|
|
1463
|
+
#endif
|
|
1464
|
+
#ifdef WOLFSSL_SHAKE128
|
|
1465
|
+
WC_HASH_TYPE_SHAKE128 = 18,
|
|
1466
|
+
#undef _WC_HASH_TYPE_MAX
|
|
1467
|
+
#define _WC_HASH_TYPE_MAX WC_HASH_TYPE_SHAKE128
|
|
1468
|
+
#endif
|
|
1469
|
+
#ifdef WOLFSSL_SHAKE256
|
|
1470
|
+
WC_HASH_TYPE_SHAKE256 = 19,
|
|
1471
|
+
#undef _WC_HASH_TYPE_MAX
|
|
1472
|
+
#define _WC_HASH_TYPE_MAX WC_HASH_TYPE_SHAKE256
|
|
1473
|
+
#endif
|
|
1474
|
+
#ifdef WOLFSSL_SM3
|
|
1475
|
+
WC_HASH_TYPE_SM3 = 20,
|
|
1476
|
+
#undef _WC_HASH_TYPE_MAX
|
|
1477
|
+
#define _WC_HASH_TYPE_MAX WC_HASH_TYPE_SM3
|
|
1478
|
+
#endif
|
|
1479
|
+
WC_HASH_TYPE_MAX = _WC_HASH_TYPE_MAX
|
|
1480
|
+
#undef _WC_HASH_TYPE_MAX
|
|
1481
|
+
|
|
1482
|
+
#endif /* HAVE_SELFTEST */
|
|
1483
|
+
};
|
|
1484
|
+
|
|
1485
|
+
enum wc_HashFlags {
|
|
1486
|
+
WC_HASH_FLAG_NONE = 0x00000000,
|
|
1487
|
+
WC_HASH_FLAG_WILLCOPY = 0x00000001, /* flag to indicate hash will be copied */
|
|
1488
|
+
WC_HASH_FLAG_ISCOPY = 0x00000002, /* hash is copy */
|
|
1489
|
+
#ifdef WOLFSSL_SHA3
|
|
1490
|
+
WC_HASH_SHA3_KECCAK256 =0x00010000, /* Older KECCAK256 */
|
|
1491
|
+
#endif
|
|
1492
|
+
WOLF_ENUM_DUMMY_LAST_ELEMENT(WC_HASH)
|
|
1493
|
+
};
|
|
1494
|
+
|
|
1495
|
+
/* cipher types */
|
|
1496
|
+
enum wc_CipherType {
|
|
1497
|
+
WC_CIPHER_NONE = 0,
|
|
1498
|
+
WC_CIPHER_AES = 1,
|
|
1499
|
+
WC_CIPHER_AES_CBC = 2,
|
|
1500
|
+
WC_CIPHER_AES_GCM = 3,
|
|
1501
|
+
WC_CIPHER_AES_CTR = 4,
|
|
1502
|
+
WC_CIPHER_AES_XTS = 5,
|
|
1503
|
+
WC_CIPHER_AES_CFB = 6,
|
|
1504
|
+
WC_CIPHER_AES_CCM = 12,
|
|
1505
|
+
WC_CIPHER_AES_ECB = 13,
|
|
1506
|
+
WC_CIPHER_DES3 = 7,
|
|
1507
|
+
WC_CIPHER_DES = 8,
|
|
1508
|
+
WC_CIPHER_CHACHA = 9,
|
|
1509
|
+
|
|
1510
|
+
WC_CIPHER_MAX = WC_CIPHER_AES_CCM
|
|
1511
|
+
};
|
|
1512
|
+
|
|
1513
|
+
/* PK=public key (asymmetric) based algorithms */
|
|
1514
|
+
enum wc_PkType {
|
|
1515
|
+
WC_PK_TYPE_NONE = 0,
|
|
1516
|
+
WC_PK_TYPE_RSA = 1,
|
|
1517
|
+
WC_PK_TYPE_DH = 2,
|
|
1518
|
+
WC_PK_TYPE_ECDH = 3,
|
|
1519
|
+
WC_PK_TYPE_ECDSA_SIGN = 4,
|
|
1520
|
+
WC_PK_TYPE_ECDSA_VERIFY = 5,
|
|
1521
|
+
WC_PK_TYPE_ED25519_SIGN = 6,
|
|
1522
|
+
WC_PK_TYPE_CURVE25519 = 7,
|
|
1523
|
+
WC_PK_TYPE_RSA_KEYGEN = 8,
|
|
1524
|
+
WC_PK_TYPE_EC_KEYGEN = 9,
|
|
1525
|
+
WC_PK_TYPE_RSA_CHECK_PRIV_KEY = 10,
|
|
1526
|
+
WC_PK_TYPE_EC_CHECK_PRIV_KEY = 11,
|
|
1527
|
+
WC_PK_TYPE_ED448 = 12,
|
|
1528
|
+
WC_PK_TYPE_CURVE448 = 13,
|
|
1529
|
+
WC_PK_TYPE_ED25519_VERIFY = 14,
|
|
1530
|
+
WC_PK_TYPE_ED25519_KEYGEN = 15,
|
|
1531
|
+
WC_PK_TYPE_CURVE25519_KEYGEN = 16,
|
|
1532
|
+
WC_PK_TYPE_RSA_GET_SIZE = 17,
|
|
1533
|
+
#define _WC_PK_TYPE_MAX WC_PK_TYPE_RSA_GET_SIZE
|
|
1534
|
+
#if defined(WOLFSSL_HAVE_MLKEM)
|
|
1535
|
+
WC_PK_TYPE_PQC_KEM_KEYGEN = 18,
|
|
1536
|
+
WC_PK_TYPE_PQC_KEM_ENCAPS = 19,
|
|
1537
|
+
WC_PK_TYPE_PQC_KEM_DECAPS = 20,
|
|
1538
|
+
#undef _WC_PK_TYPE_MAX
|
|
1539
|
+
#define _WC_PK_TYPE_MAX WC_PK_TYPE_PQC_KEM_DECAPS
|
|
1540
|
+
#endif
|
|
1541
|
+
#if defined(HAVE_DILITHIUM) || defined(HAVE_FALCON)
|
|
1542
|
+
WC_PK_TYPE_PQC_SIG_KEYGEN = 21,
|
|
1543
|
+
WC_PK_TYPE_PQC_SIG_SIGN = 22,
|
|
1544
|
+
WC_PK_TYPE_PQC_SIG_VERIFY = 23,
|
|
1545
|
+
WC_PK_TYPE_PQC_SIG_CHECK_PRIV_KEY = 24,
|
|
1546
|
+
#undef _WC_PK_TYPE_MAX
|
|
1547
|
+
#define _WC_PK_TYPE_MAX WC_PK_TYPE_PQC_SIG_CHECK_PRIV_KEY
|
|
1548
|
+
#endif
|
|
1549
|
+
WC_PK_TYPE_RSA_PKCS = 25,
|
|
1550
|
+
WC_PK_TYPE_RSA_PSS = 26,
|
|
1551
|
+
WC_PK_TYPE_RSA_OAEP = 27,
|
|
1552
|
+
WC_PK_TYPE_MAX = _WC_PK_TYPE_MAX
|
|
1553
|
+
};
|
|
1554
|
+
|
|
1555
|
+
#if defined(WOLFSSL_HAVE_MLKEM)
|
|
1556
|
+
/* Post quantum KEM algorithms */
|
|
1557
|
+
enum wc_PqcKemType {
|
|
1558
|
+
WC_PQC_KEM_TYPE_NONE = 0,
|
|
1559
|
+
#define _WC_PQC_KEM_TYPE_MAX WC_PQC_KEM_TYPE_NONE
|
|
1560
|
+
#if defined(WOLFSSL_HAVE_MLKEM)
|
|
1561
|
+
WC_PQC_KEM_TYPE_KYBER = 1,
|
|
1562
|
+
#undef _WC_PQC_KEM_TYPE_MAX
|
|
1563
|
+
#define _WC_PQC_KEM_TYPE_MAX WC_PQC_KEM_TYPE_KYBER
|
|
1564
|
+
#endif
|
|
1565
|
+
WC_PQC_KEM_TYPE_MAX = _WC_PQC_KEM_TYPE_MAX
|
|
1566
|
+
};
|
|
1567
|
+
#endif
|
|
1568
|
+
|
|
1569
|
+
#if defined(HAVE_DILITHIUM) || defined(HAVE_FALCON)
|
|
1570
|
+
/* Post quantum signature algorithms */
|
|
1571
|
+
enum wc_PqcSignatureType {
|
|
1572
|
+
WC_PQC_SIG_TYPE_NONE = 0,
|
|
1573
|
+
#define _WC_PQC_SIG_TYPE_MAX WC_PQC_SIG_TYPE_NONE
|
|
1574
|
+
#if defined(HAVE_DILITHIUM)
|
|
1575
|
+
WC_PQC_SIG_TYPE_DILITHIUM = 1,
|
|
1576
|
+
#undef _WC_PQC_SIG_TYPE_MAX
|
|
1577
|
+
#define _WC_PQC_SIG_TYPE_MAX WC_PQC_SIG_TYPE_DILITHIUM
|
|
1578
|
+
#endif
|
|
1579
|
+
#if defined(HAVE_FALCON)
|
|
1580
|
+
WC_PQC_SIG_TYPE_FALCON = 2,
|
|
1581
|
+
#undef _WC_PQC_SIG_TYPE_MAX
|
|
1582
|
+
#define _WC_PQC_SIG_TYPE_MAX WC_PQC_SIG_TYPE_FALCON
|
|
1583
|
+
#endif
|
|
1584
|
+
WC_PQC_SIG_TYPE_MAX = _WC_PQC_SIG_TYPE_MAX
|
|
1585
|
+
};
|
|
1586
|
+
#endif
|
|
1587
|
+
|
|
1588
|
+
|
|
1589
|
+
/* settings detection for compile vs runtime math incompatibilities */
|
|
1590
|
+
enum {
|
|
1591
|
+
#if !defined(USE_FAST_MATH) && !defined(SIZEOF_LONG) && !defined(SIZEOF_LONG_LONG)
|
|
1592
|
+
CTC_SETTINGS = 0x0
|
|
1593
|
+
#elif !defined(USE_FAST_MATH) && defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
|
|
1594
|
+
CTC_SETTINGS = 0x1
|
|
1595
|
+
#elif !defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 8)
|
|
1596
|
+
CTC_SETTINGS = 0x2
|
|
1597
|
+
#elif !defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 4)
|
|
1598
|
+
CTC_SETTINGS = 0x4
|
|
1599
|
+
#elif defined(USE_FAST_MATH) && !defined(SIZEOF_LONG) && !defined(SIZEOF_LONG_LONG)
|
|
1600
|
+
CTC_SETTINGS = 0x8
|
|
1601
|
+
#elif defined(USE_FAST_MATH) && defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
|
|
1602
|
+
CTC_SETTINGS = 0x10
|
|
1603
|
+
#elif defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 8)
|
|
1604
|
+
CTC_SETTINGS = 0x20
|
|
1605
|
+
#elif defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 4)
|
|
1606
|
+
CTC_SETTINGS = 0x40
|
|
1607
|
+
#else
|
|
1608
|
+
#error "bad math long / long long settings"
|
|
1609
|
+
#endif
|
|
1610
|
+
};
|
|
1611
|
+
|
|
1612
|
+
|
|
1613
|
+
#ifdef WOLFSSL_API_PREFIX_MAP
|
|
1614
|
+
#define CheckRunTimeSettings wc_CheckRunTimeSettings
|
|
1615
|
+
#endif
|
|
1616
|
+
WOLFSSL_API word32 CheckRunTimeSettings(void);
|
|
1617
|
+
|
|
1618
|
+
/* If user uses RSA, DH, DSA, or ECC math lib directly then fast math and long
|
|
1619
|
+
* types need to match at compile time and run time, CheckCtcSettings will
|
|
1620
|
+
* return 1 if a match otherwise 0 */
|
|
1621
|
+
#define CheckCtcSettings() (CTC_SETTINGS == CheckRunTimeSettings())
|
|
1622
|
+
|
|
1623
|
+
/* invalid device id */
|
|
1624
|
+
#define INVALID_DEVID (-2)
|
|
1625
|
+
|
|
1626
|
+
#if defined(HAVE_FIPS) && FIPS_VERSION_LT(5,3)
|
|
1627
|
+
#ifdef XASM_LINK
|
|
1628
|
+
#error User-supplied XASM_LINK is not compatible with this FIPS version.
|
|
1629
|
+
#else
|
|
1630
|
+
/* use version in FIPS <=5.2 aes.c */
|
|
1631
|
+
#endif
|
|
1632
|
+
#elif defined(XASM_LINK)
|
|
1633
|
+
/* keep user-supplied definition */
|
|
1634
|
+
#elif defined(WOLFSSL_NO_ASM)
|
|
1635
|
+
#define XASM_LINK(f) /* null expansion */
|
|
1636
|
+
#elif defined(_MSC_VER)
|
|
1637
|
+
#define XASM_LINK(f) /* null expansion */
|
|
1638
|
+
#elif defined(__APPLE__)
|
|
1639
|
+
#define XASM_LINK(f) asm("_" f)
|
|
1640
|
+
#elif defined(__GNUC__)
|
|
1641
|
+
/* use alternate keyword for compatibility with -std=c99 */
|
|
1642
|
+
#define XASM_LINK(f) __asm__(f)
|
|
1643
|
+
#else
|
|
1644
|
+
#define XASM_LINK(f) asm(f)
|
|
1645
|
+
#endif
|
|
1646
|
+
|
|
1647
|
+
/* AESNI requires alignment and ARMASM gains some performance from it.
|
|
1648
|
+
* Xilinx RSA operations require alignment.
|
|
1649
|
+
*/
|
|
1650
|
+
#if defined(WOLFSSL_AESNI) || defined(WOLFSSL_ARMASM) || \
|
|
1651
|
+
defined(USE_INTEL_SPEEDUP) || defined(WOLFSSL_AFALG_XILINX) || \
|
|
1652
|
+
defined(WOLFSSL_XILINX)
|
|
1653
|
+
#ifndef WOLFSSL_USE_ALIGN
|
|
1654
|
+
#define WOLFSSL_USE_ALIGN
|
|
1655
|
+
#endif
|
|
1656
|
+
#endif /* WOLFSSL_AESNI || WOLFSSL_ARMASM || USE_INTEL_SPEEDUP || \
|
|
1657
|
+
* WOLFSSL_AFALG_XILINX */
|
|
1658
|
+
|
|
1659
|
+
/* Helpers for memory alignment */
|
|
1660
|
+
#ifndef XALIGNED
|
|
1661
|
+
#if defined(__GNUC__) || defined(__llvm__) || \
|
|
1662
|
+
defined(__IAR_SYSTEMS_ICC__)
|
|
1663
|
+
#define XALIGNED(x) __attribute__ ( (aligned (x)))
|
|
1664
|
+
#elif defined(__KEIL__)
|
|
1665
|
+
#define XALIGNED(x) __align(x)
|
|
1666
|
+
#elif defined(__WATCOMC__) /* && (_MSC_VER or !_MSC_VER) */
|
|
1667
|
+
/* No align available for Open Watcom V2, expansion comment needed: */
|
|
1668
|
+
#define XALIGNED(x) /* null expansion */
|
|
1669
|
+
#elif defined(_MSC_VER)
|
|
1670
|
+
/* disable align warning, we want alignment ! */
|
|
1671
|
+
#pragma warning(disable: 4324)
|
|
1672
|
+
#define XALIGNED(x) __declspec (align (x))
|
|
1673
|
+
#else
|
|
1674
|
+
#define XALIGNED(x) /* null expansion */
|
|
1675
|
+
#endif
|
|
1676
|
+
#endif
|
|
1677
|
+
|
|
1678
|
+
/* Only use alignment in wolfSSL/wolfCrypt if WOLFSSL_USE_ALIGN is set */
|
|
1679
|
+
#ifdef WOLFSSL_USE_ALIGN
|
|
1680
|
+
/* For IAR ARM the maximum variable alignment on stack is 8-bytes.
|
|
1681
|
+
* Variables declared outside stack (like static globals) can have
|
|
1682
|
+
* higher alignment. */
|
|
1683
|
+
#if defined(__ICCARM__)
|
|
1684
|
+
#define WOLFSSL_ALIGN(x) XALIGNED(8)
|
|
1685
|
+
#else
|
|
1686
|
+
#define WOLFSSL_ALIGN(x) XALIGNED(x)
|
|
1687
|
+
#endif
|
|
1688
|
+
#else
|
|
1689
|
+
#define WOLFSSL_ALIGN(x) /* null expansion */
|
|
1690
|
+
#endif
|
|
1691
|
+
|
|
1692
|
+
#ifndef ALIGN8
|
|
1693
|
+
#define ALIGN8 WOLFSSL_ALIGN(8)
|
|
1694
|
+
#endif
|
|
1695
|
+
#ifndef ALIGN16
|
|
1696
|
+
#define ALIGN16 WOLFSSL_ALIGN(16)
|
|
1697
|
+
#endif
|
|
1698
|
+
#ifndef ALIGN32
|
|
1699
|
+
#define ALIGN32 WOLFSSL_ALIGN(32)
|
|
1700
|
+
#endif
|
|
1701
|
+
#ifndef ALIGN64
|
|
1702
|
+
#define ALIGN64 WOLFSSL_ALIGN(64)
|
|
1703
|
+
#endif
|
|
1704
|
+
#ifndef ALIGN128
|
|
1705
|
+
#define ALIGN128 WOLFSSL_ALIGN(128)
|
|
1706
|
+
#endif
|
|
1707
|
+
#ifndef ALIGN256
|
|
1708
|
+
#define ALIGN256 WOLFSSL_ALIGN(256)
|
|
1709
|
+
#endif
|
|
1710
|
+
|
|
1711
|
+
#if !defined(PEDANTIC_EXTENSION)
|
|
1712
|
+
#if defined(__GNUC__)
|
|
1713
|
+
#define PEDANTIC_EXTENSION __extension__
|
|
1714
|
+
#else
|
|
1715
|
+
#define PEDANTIC_EXTENSION
|
|
1716
|
+
#endif
|
|
1717
|
+
#endif /* !PEDANTIC_EXTENSION */
|
|
1718
|
+
|
|
1719
|
+
|
|
1720
|
+
#ifndef TRUE
|
|
1721
|
+
#define TRUE 1
|
|
1722
|
+
#endif
|
|
1723
|
+
#ifndef FALSE
|
|
1724
|
+
#define FALSE 0
|
|
1725
|
+
#endif
|
|
1726
|
+
|
|
1727
|
+
#ifdef SINGLE_THREADED
|
|
1728
|
+
#if defined(WC_32BIT_CPU) || defined(HAVE_STACK_SIZE)
|
|
1729
|
+
typedef void* THREAD_RETURN;
|
|
1730
|
+
#else
|
|
1731
|
+
typedef unsigned int THREAD_RETURN;
|
|
1732
|
+
#endif
|
|
1733
|
+
typedef void* THREAD_TYPE;
|
|
1734
|
+
#define WOLFSSL_THREAD
|
|
1735
|
+
#elif defined(WOLFSSL_USER_THREADING)
|
|
1736
|
+
/* User can define user specific threading types
|
|
1737
|
+
* THREAD_RETURN
|
|
1738
|
+
* THREAD_TYPE
|
|
1739
|
+
* WOLFSSL_THREAD
|
|
1740
|
+
* e.g.
|
|
1741
|
+
* typedef unsigned int THREAD_RETURN;
|
|
1742
|
+
* typedef size_t THREAD_TYPE;
|
|
1743
|
+
* #define WOLFSSL_THREAD void
|
|
1744
|
+
*
|
|
1745
|
+
* User can also implement their own wolfSSL_NewThread(),
|
|
1746
|
+
* wolfSSL_JoinThread() and wolfSSL_Cond signaling if they want.
|
|
1747
|
+
* Otherwise, those functions are omitted.
|
|
1748
|
+
*/
|
|
1749
|
+
#elif defined(__WATCOMC__)
|
|
1750
|
+
#if __WATCOMC__ < 1300
|
|
1751
|
+
#define _WCCALLBACK
|
|
1752
|
+
#endif
|
|
1753
|
+
#if defined(__MACH__)
|
|
1754
|
+
#include <dispatch/dispatch.h>
|
|
1755
|
+
#include <pthread.h>
|
|
1756
|
+
typedef struct COND_TYPE {
|
|
1757
|
+
dispatch_semaphore_t cond;
|
|
1758
|
+
} COND_TYPE;
|
|
1759
|
+
typedef void* THREAD_RETURN;
|
|
1760
|
+
typedef pthread_t THREAD_TYPE;
|
|
1761
|
+
#define WOLFSSL_COND
|
|
1762
|
+
#define WOLFSSL_THREAD
|
|
1763
|
+
#ifndef HAVE_SELFTEST
|
|
1764
|
+
#define WOLFSSL_THREAD_NO_JOIN
|
|
1765
|
+
#endif
|
|
1766
|
+
#elif defined(__NT__) || defined(INTIME_RTOS)
|
|
1767
|
+
typedef unsigned THREAD_RETURN;
|
|
1768
|
+
typedef uintptr_t THREAD_TYPE;
|
|
1769
|
+
typedef struct COND_TYPE {
|
|
1770
|
+
wolfSSL_Mutex mutex;
|
|
1771
|
+
HANDLE cond;
|
|
1772
|
+
} COND_TYPE;
|
|
1773
|
+
#define WOLFSSL_COND
|
|
1774
|
+
#define INVALID_THREAD_VAL ((THREAD_TYPE)(INVALID_HANDLE_VALUE))
|
|
1775
|
+
#define WOLFSSL_THREAD __stdcall
|
|
1776
|
+
#define WOLFSSL_THREAD_NO_JOIN _WCCALLBACK
|
|
1777
|
+
#elif defined(__OS2__)
|
|
1778
|
+
#define WOLFSSL_THREAD_VOID_RETURN
|
|
1779
|
+
typedef void THREAD_RETURN;
|
|
1780
|
+
typedef TID THREAD_TYPE;
|
|
1781
|
+
typedef struct COND_TYPE {
|
|
1782
|
+
wolfSSL_Mutex mutex;
|
|
1783
|
+
LHANDLE cond;
|
|
1784
|
+
} COND_TYPE;
|
|
1785
|
+
#define WOLFSSL_COND
|
|
1786
|
+
#define INVALID_THREAD_VAL ((THREAD_TYPE)(-1))
|
|
1787
|
+
#define WOLFSSL_THREAD _WCCALLBACK
|
|
1788
|
+
#define WOLFSSL_THREAD_NO_JOIN _WCCALLBACK
|
|
1789
|
+
#elif defined(__LINUX__)
|
|
1790
|
+
#include <pthread.h>
|
|
1791
|
+
typedef struct COND_TYPE {
|
|
1792
|
+
pthread_mutex_t mutex;
|
|
1793
|
+
pthread_cond_t cond;
|
|
1794
|
+
} COND_TYPE;
|
|
1795
|
+
typedef void* THREAD_RETURN;
|
|
1796
|
+
typedef pthread_t THREAD_TYPE;
|
|
1797
|
+
#define WOLFSSL_COND
|
|
1798
|
+
#define WOLFSSL_THREAD
|
|
1799
|
+
#ifndef HAVE_SELFTEST
|
|
1800
|
+
#define WOLFSSL_THREAD_NO_JOIN
|
|
1801
|
+
#endif
|
|
1802
|
+
#endif
|
|
1803
|
+
#elif defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET) || \
|
|
1804
|
+
defined(FREESCALE_MQX)
|
|
1805
|
+
typedef unsigned int THREAD_RETURN;
|
|
1806
|
+
typedef int THREAD_TYPE;
|
|
1807
|
+
#define WOLFSSL_THREAD
|
|
1808
|
+
#elif defined(WOLFSSL_NUCLEUS)
|
|
1809
|
+
typedef unsigned int THREAD_RETURN;
|
|
1810
|
+
typedef intptr_t THREAD_TYPE;
|
|
1811
|
+
#define WOLFSSL_THREAD
|
|
1812
|
+
#elif defined(WOLFSSL_TIRTOS)
|
|
1813
|
+
typedef void THREAD_RETURN;
|
|
1814
|
+
#define WOLFSSL_THREAD_VOID_RETURN
|
|
1815
|
+
typedef Task_Handle THREAD_TYPE;
|
|
1816
|
+
#define WOLFSSL_THREAD
|
|
1817
|
+
#elif defined(WOLFSSL_ZEPHYR)
|
|
1818
|
+
typedef void THREAD_RETURN;
|
|
1819
|
+
#define WOLFSSL_THREAD_VOID_RETURN
|
|
1820
|
+
typedef struct {
|
|
1821
|
+
/* Zephyr k_thread can be large, > 128 bytes. */
|
|
1822
|
+
struct k_thread* tid;
|
|
1823
|
+
k_thread_stack_t* threadStack;
|
|
1824
|
+
} THREAD_TYPE;
|
|
1825
|
+
#define WOLFSSL_THREAD
|
|
1826
|
+
extern void* wolfsslThreadHeapHint;
|
|
1827
|
+
#elif defined(NETOS)
|
|
1828
|
+
typedef UINT THREAD_RETURN;
|
|
1829
|
+
typedef struct {
|
|
1830
|
+
TX_THREAD tid;
|
|
1831
|
+
void* threadStack;
|
|
1832
|
+
} THREAD_TYPE;
|
|
1833
|
+
#define WOLFSSL_THREAD
|
|
1834
|
+
#define INFINITE TX_WAIT_FOREVER
|
|
1835
|
+
#define WAIT_OBJECT_0 TX_NO_WAIT
|
|
1836
|
+
#elif defined(WOLFSSL_LINUXKM) || defined(WOLFSSL_BSDKM)
|
|
1837
|
+
typedef unsigned int THREAD_RETURN;
|
|
1838
|
+
typedef size_t THREAD_TYPE;
|
|
1839
|
+
#define WOLFSSL_THREAD
|
|
1840
|
+
#elif defined(WOLFSSL_PTHREADS)
|
|
1841
|
+
#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 \
|
|
1842
|
+
&& !defined(__ppc__)
|
|
1843
|
+
#include <dispatch/dispatch.h>
|
|
1844
|
+
typedef struct COND_TYPE {
|
|
1845
|
+
wolfSSL_Mutex mutex;
|
|
1846
|
+
dispatch_semaphore_t cond;
|
|
1847
|
+
} COND_TYPE;
|
|
1848
|
+
#else
|
|
1849
|
+
#include <pthread.h>
|
|
1850
|
+
typedef struct COND_TYPE {
|
|
1851
|
+
pthread_mutex_t mutex;
|
|
1852
|
+
pthread_cond_t cond;
|
|
1853
|
+
} COND_TYPE;
|
|
1854
|
+
#endif
|
|
1855
|
+
typedef void* THREAD_RETURN;
|
|
1856
|
+
typedef pthread_t THREAD_TYPE;
|
|
1857
|
+
#define WOLFSSL_COND
|
|
1858
|
+
#define WOLFSSL_THREAD
|
|
1859
|
+
#ifndef HAVE_SELFTEST
|
|
1860
|
+
#define WOLFSSL_THREAD_NO_JOIN
|
|
1861
|
+
#endif
|
|
1862
|
+
#elif defined(FREERTOS) && defined(WOLFSSL_ESPIDF)
|
|
1863
|
+
typedef void* THREAD_RETURN;
|
|
1864
|
+
typedef pthread_t THREAD_TYPE;
|
|
1865
|
+
#define WOLFSSL_THREAD
|
|
1866
|
+
#elif defined(FREERTOS)
|
|
1867
|
+
typedef unsigned int THREAD_RETURN;
|
|
1868
|
+
typedef TaskHandle_t THREAD_TYPE;
|
|
1869
|
+
#define WOLFSSL_THREAD
|
|
1870
|
+
#elif defined(_WIN32_WCE)
|
|
1871
|
+
typedef unsigned THREAD_RETURN;
|
|
1872
|
+
typedef size_t THREAD_TYPE;
|
|
1873
|
+
typedef struct COND_TYPE {
|
|
1874
|
+
wolfSSL_Mutex mutex;
|
|
1875
|
+
HANDLE cond;
|
|
1876
|
+
} COND_TYPE;
|
|
1877
|
+
#define WOLFSSL_COND
|
|
1878
|
+
#define INVALID_THREAD_VAL ((THREAD_TYPE)(INVALID_HANDLE_VALUE))
|
|
1879
|
+
#define WOLFSSL_THREAD __stdcall
|
|
1880
|
+
#define WOLFSSL_THREAD_NO_JOIN __cdecl
|
|
1881
|
+
#elif defined(USE_WINDOWS_API)
|
|
1882
|
+
typedef unsigned THREAD_RETURN;
|
|
1883
|
+
typedef uintptr_t THREAD_TYPE;
|
|
1884
|
+
typedef struct COND_TYPE {
|
|
1885
|
+
wolfSSL_Mutex mutex;
|
|
1886
|
+
HANDLE cond;
|
|
1887
|
+
} COND_TYPE;
|
|
1888
|
+
#define WOLFSSL_COND
|
|
1889
|
+
#define INVALID_THREAD_VAL ((THREAD_TYPE)(INVALID_HANDLE_VALUE))
|
|
1890
|
+
#define WOLFSSL_THREAD __stdcall
|
|
1891
|
+
#if !defined(__MINGW32__)
|
|
1892
|
+
#define WOLFSSL_THREAD_NO_JOIN __cdecl
|
|
1893
|
+
#endif
|
|
1894
|
+
#elif defined(THREADX)
|
|
1895
|
+
typedef unsigned int THREAD_RETURN;
|
|
1896
|
+
typedef TX_THREAD THREAD_TYPE;
|
|
1897
|
+
#define WOLFSSL_THREAD
|
|
1898
|
+
#elif defined(INTIME_RTOS)
|
|
1899
|
+
typedef unsigned int THREAD_RETURN;
|
|
1900
|
+
#define INTIME_THREAD_TYPE THREAD_TYPE
|
|
1901
|
+
#undef THREAD_TYPE
|
|
1902
|
+
typedef uintptr_t THREAD_TYPE;
|
|
1903
|
+
#define WOLFSSL_THREAD __stdcall
|
|
1904
|
+
#else
|
|
1905
|
+
typedef unsigned int THREAD_RETURN;
|
|
1906
|
+
typedef size_t THREAD_TYPE;
|
|
1907
|
+
#define WOLFSSL_THREAD __stdcall
|
|
1908
|
+
#endif
|
|
1909
|
+
|
|
1910
|
+
#ifndef SINGLE_THREADED
|
|
1911
|
+
/* Necessary headers should already be included. */
|
|
1912
|
+
|
|
1913
|
+
#ifndef INVALID_THREAD_VAL
|
|
1914
|
+
#define INVALID_THREAD_VAL ((THREAD_TYPE)(-1))
|
|
1915
|
+
#endif
|
|
1916
|
+
|
|
1917
|
+
#ifndef WOLFSSL_THREAD_VOID_RETURN
|
|
1918
|
+
#define WOLFSSL_RETURN_FROM_THREAD(x) return (THREAD_RETURN)(x)
|
|
1919
|
+
#else
|
|
1920
|
+
#define WOLFSSL_RETURN_FROM_THREAD(x) \
|
|
1921
|
+
do { (void)(x); return; } while(0)
|
|
1922
|
+
#endif
|
|
1923
|
+
|
|
1924
|
+
/* List of defines/types and what they mean:
|
|
1925
|
+
* THREAD_RETURN - return type of a thread callback
|
|
1926
|
+
* THREAD_TYPE - type that should be passed into thread handling API
|
|
1927
|
+
* INVALID_THREAD_VAL - a value that THREAD_TYPE can be checked against
|
|
1928
|
+
* to check if the value is an invalid thread
|
|
1929
|
+
* WOLFSSL_THREAD - attribute that should be used to declare thread
|
|
1930
|
+
* callbacks
|
|
1931
|
+
* WOLFSSL_COND - defined if this system supports signaling
|
|
1932
|
+
* COND_TYPE - type that should be passed into the signaling API
|
|
1933
|
+
* WOLFSSL_THREAD_VOID_RETURN - defined if the thread callback has a
|
|
1934
|
+
* void return
|
|
1935
|
+
* WOLFSSL_RETURN_FROM_THREAD - define used to correctly return from a
|
|
1936
|
+
* thread callback
|
|
1937
|
+
* THREAD_CB - thread callback type for regular threading API
|
|
1938
|
+
*
|
|
1939
|
+
* WOLFSSL_THREAD_NO_JOIN - attribute used to declare thread callbacks
|
|
1940
|
+
* that do not require cleanup
|
|
1941
|
+
* THREAD_CB_NOJOIN - thread callback type for thread APIs that do not
|
|
1942
|
+
* require cleanup
|
|
1943
|
+
* THREAD_RETURN_NOJOIN - return type used to declare thread callbacks
|
|
1944
|
+
* that do not require cleanup
|
|
1945
|
+
* RETURN_FROM_THREAD_NOJOIN - define used to correctly return from
|
|
1946
|
+
* a thread callback that do not require
|
|
1947
|
+
* cleanup
|
|
1948
|
+
*
|
|
1949
|
+
* Other defines/types are specific for the threading implementation
|
|
1950
|
+
*/
|
|
1951
|
+
|
|
1952
|
+
/* Internal wolfSSL threading interface. It does NOT need to be ported
|
|
1953
|
+
* during initial porting efforts. This is a very basic interface. Some
|
|
1954
|
+
* areas don't use this interface on purpose as they need more control
|
|
1955
|
+
* over threads.
|
|
1956
|
+
*
|
|
1957
|
+
* It is currently used for:
|
|
1958
|
+
* - CRL monitor
|
|
1959
|
+
* - Testing
|
|
1960
|
+
* - Entropy generation */
|
|
1961
|
+
|
|
1962
|
+
/* We don't support returns from threads */
|
|
1963
|
+
typedef THREAD_RETURN (WOLFSSL_THREAD *THREAD_CB)(void* arg);
|
|
1964
|
+
WOLFSSL_API int wolfSSL_NewThread(THREAD_TYPE* thread,
|
|
1965
|
+
THREAD_CB cb, void* arg);
|
|
1966
|
+
#ifdef WOLFSSL_THREAD_NO_JOIN
|
|
1967
|
+
/* Create a thread that will be automatically cleaned up. We can't
|
|
1968
|
+
* return a handle/pointer to the new thread because there are no
|
|
1969
|
+
* guarantees for how long it will be valid. */
|
|
1970
|
+
#if defined(WOLFSSL_PTHREADS)
|
|
1971
|
+
#define THREAD_CB_NOJOIN THREAD_CB
|
|
1972
|
+
#define THREAD_RETURN_NOJOIN THREAD_RETURN
|
|
1973
|
+
#define RETURN_FROM_THREAD_NOJOIN(x) \
|
|
1974
|
+
WOLFSSL_RETURN_FROM_THREAD(x)
|
|
1975
|
+
#else
|
|
1976
|
+
#define THREAD_RETURN_NOJOIN void
|
|
1977
|
+
typedef THREAD_RETURN_NOJOIN
|
|
1978
|
+
(WOLFSSL_THREAD_NO_JOIN *THREAD_CB_NOJOIN)(void* arg);
|
|
1979
|
+
#define RETURN_FROM_THREAD_NOJOIN(x) return
|
|
1980
|
+
#endif
|
|
1981
|
+
WOLFSSL_API int wolfSSL_NewThreadNoJoin(THREAD_CB_NOJOIN cb,
|
|
1982
|
+
void* arg);
|
|
1983
|
+
#endif
|
|
1984
|
+
WOLFSSL_API int wolfSSL_JoinThread(THREAD_TYPE thread);
|
|
1985
|
+
|
|
1986
|
+
#ifdef WOLFSSL_COND
|
|
1987
|
+
WOLFSSL_API int wolfSSL_CondInit(COND_TYPE* cond);
|
|
1988
|
+
WOLFSSL_API int wolfSSL_CondFree(COND_TYPE* cond);
|
|
1989
|
+
WOLFSSL_API int wolfSSL_CondSignal(COND_TYPE* cond);
|
|
1990
|
+
WOLFSSL_API int wolfSSL_CondWait(COND_TYPE* cond);
|
|
1991
|
+
WOLFSSL_API int wolfSSL_CondStart(COND_TYPE* cond);
|
|
1992
|
+
WOLFSSL_API int wolfSSL_CondEnd(COND_TYPE* cond);
|
|
1993
|
+
#endif
|
|
1994
|
+
|
|
1995
|
+
#ifdef INTIME_RTOS
|
|
1996
|
+
#undef THREAD_TYPE
|
|
1997
|
+
#define THREAD_TYPE INTIME_THREAD_TYPE
|
|
1998
|
+
#undef INTIME_THREAD_TYPE
|
|
1999
|
+
#endif
|
|
2000
|
+
#else
|
|
2001
|
+
#define WOLFSSL_RETURN_FROM_THREAD(x) return (THREAD_RETURN)(x)
|
|
2002
|
+
#endif /* SINGLE_THREADED */
|
|
2003
|
+
|
|
2004
|
+
#if defined(HAVE_STACK_SIZE)
|
|
2005
|
+
#define EXIT_TEST(ret) return (THREAD_RETURN)((size_t)(ret))
|
|
2006
|
+
#else
|
|
2007
|
+
#define EXIT_TEST(ret) return ret
|
|
2008
|
+
#endif
|
|
2009
|
+
|
|
2010
|
+
|
|
2011
|
+
#if (defined(__IAR_SYSTEMS_ICC__) && (__IAR_SYSTEMS_ICC__ > 8)) || \
|
|
2012
|
+
defined(__GNUC__)
|
|
2013
|
+
#define WOLFSSL_PACK __attribute__ ((packed))
|
|
2014
|
+
#else
|
|
2015
|
+
#define WOLFSSL_PACK
|
|
2016
|
+
#endif
|
|
2017
|
+
|
|
2018
|
+
#ifndef __GNUC_PREREQ
|
|
2019
|
+
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
|
|
2020
|
+
#define __GNUC_PREREQ(maj, min) \
|
|
2021
|
+
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
|
2022
|
+
#else
|
|
2023
|
+
#define __GNUC_PREREQ(maj, min) (0) /* not GNUC */
|
|
2024
|
+
#endif
|
|
2025
|
+
#endif
|
|
2026
|
+
|
|
2027
|
+
#if defined(__IAR_SYSTEMS_ICC__) || defined(__GNUC__)
|
|
2028
|
+
#define WC_NORETURN __attribute__((noreturn))
|
|
2029
|
+
#else
|
|
2030
|
+
#define WC_NORETURN
|
|
2031
|
+
#endif
|
|
2032
|
+
|
|
2033
|
+
#if defined(WOLFSSL_KEY_GEN) || defined(HAVE_COMP_KEY) || \
|
|
2034
|
+
defined(WOLFSSL_DEBUG_MATH) || defined(DEBUG_WOLFSSL) || \
|
|
2035
|
+
defined(WOLFSSL_PUBLIC_MP) || defined(OPENSSL_EXTRA) || \
|
|
2036
|
+
(defined(HAVE_ECC) && defined(HAVE_ECC_KEY_EXPORT))
|
|
2037
|
+
#undef WC_MP_TO_RADIX
|
|
2038
|
+
#define WC_MP_TO_RADIX
|
|
2039
|
+
#endif
|
|
2040
|
+
|
|
2041
|
+
#if defined(__GNUC__) && __GNUC__ > 5
|
|
2042
|
+
#define PRAGMA_GCC_DIAG_PUSH _Pragma("GCC diagnostic push")
|
|
2043
|
+
#define PRAGMA_GCC(str) _Pragma(str)
|
|
2044
|
+
#define PRAGMA_GCC_DIAG_POP _Pragma("GCC diagnostic pop")
|
|
2045
|
+
#define PRAGMA_DIAG_PUSH PRAGMA_GCC_DIAG_PUSH
|
|
2046
|
+
#define PRAGMA(str) PRAGMA_GCC(str)
|
|
2047
|
+
#define PRAGMA_DIAG_POP PRAGMA_GCC_DIAG_POP
|
|
2048
|
+
#else
|
|
2049
|
+
#define PRAGMA_GCC_DIAG_PUSH /* null expansion */
|
|
2050
|
+
#define PRAGMA_GCC(str) /* null expansion */
|
|
2051
|
+
#define PRAGMA_GCC_DIAG_POP /* null expansion */
|
|
2052
|
+
#endif
|
|
2053
|
+
|
|
2054
|
+
#ifdef __clang__
|
|
2055
|
+
#define PRAGMA_CLANG_DIAG_PUSH _Pragma("clang diagnostic push")
|
|
2056
|
+
#define PRAGMA_CLANG(str) _Pragma(str)
|
|
2057
|
+
#define PRAGMA_CLANG_DIAG_POP _Pragma("clang diagnostic pop")
|
|
2058
|
+
#define PRAGMA_DIAG_PUSH PRAGMA_CLANG_DIAG_PUSH
|
|
2059
|
+
#define PRAGMA(str) PRAGMA_CLANG(str)
|
|
2060
|
+
#define PRAGMA_DIAG_POP PRAGMA_CLANG_DIAG_POP
|
|
2061
|
+
#else
|
|
2062
|
+
#define PRAGMA_CLANG_DIAG_PUSH /* null expansion */
|
|
2063
|
+
#define PRAGMA_CLANG(str) /* null expansion */
|
|
2064
|
+
#define PRAGMA_CLANG_DIAG_POP /* null expansion */
|
|
2065
|
+
#endif
|
|
2066
|
+
|
|
2067
|
+
#ifndef PRAGMA_DIAG_PUSH
|
|
2068
|
+
#define PRAGMA_DIAG_PUSH /* null expansion */
|
|
2069
|
+
#endif
|
|
2070
|
+
#ifndef PRAGMA
|
|
2071
|
+
#define PRAGMA(str) /* null expansion */
|
|
2072
|
+
#endif
|
|
2073
|
+
#ifndef PRAGMA_DIAG_POP
|
|
2074
|
+
#define PRAGMA_DIAG_POP /* null expansion */
|
|
2075
|
+
#endif
|
|
2076
|
+
|
|
2077
|
+
#define WC_CPP_CAT4_(a, b, c, d) a ## b ## c ## d
|
|
2078
|
+
#define WC_CPP_CAT4(a, b, c, d) WC_CPP_CAT4_(a, b, c, d)
|
|
2079
|
+
#if defined(WC_NO_STATIC_ASSERT)
|
|
2080
|
+
#define wc_static_assert(expr) struct wc_static_assert_dummy_struct
|
|
2081
|
+
#define wc_static_assert2(expr, msg) wc_static_assert(expr)
|
|
2082
|
+
#elif !defined(wc_static_assert)
|
|
2083
|
+
#if defined(WOLFSSL_HAVE_ASSERT_H) && !defined(WOLFSSL_NO_ASSERT_H)
|
|
2084
|
+
#include <assert.h>
|
|
2085
|
+
#endif
|
|
2086
|
+
#if (defined(__cplusplus) && (__cplusplus >= 201703L)) || \
|
|
2087
|
+
(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)) || \
|
|
2088
|
+
(defined(_MSVC_LANG) && (__cpp_static_assert >= 201411L))
|
|
2089
|
+
/* native variadic static_assert() */
|
|
2090
|
+
#define wc_static_assert static_assert
|
|
2091
|
+
#ifndef wc_static_assert2
|
|
2092
|
+
#define wc_static_assert2 static_assert
|
|
2093
|
+
#endif
|
|
2094
|
+
#elif (defined(_MSC_VER) && (__STDC_VERSION__ >= 201112L)) || \
|
|
2095
|
+
(defined(_MSVC_LANG) && (__cpp_static_assert >= 200410L))
|
|
2096
|
+
/* native 2-argument static_assert() */
|
|
2097
|
+
#define wc_static_assert(expr) static_assert(expr, #expr)
|
|
2098
|
+
#ifndef wc_static_assert2
|
|
2099
|
+
#define wc_static_assert2(expr, msg) static_assert(expr, msg)
|
|
2100
|
+
#endif
|
|
2101
|
+
#elif !defined(__cplusplus) && \
|
|
2102
|
+
!defined(__STRICT_ANSI__) && \
|
|
2103
|
+
!defined(WOLF_C89) && \
|
|
2104
|
+
defined(__STDC_VERSION__) && \
|
|
2105
|
+
(__STDC_VERSION__ >= 201112L) && \
|
|
2106
|
+
((defined(__GNUC__) && \
|
|
2107
|
+
(__GNUC__ >= 5)) || \
|
|
2108
|
+
defined(__clang__))
|
|
2109
|
+
/* native 2-argument _Static_assert() */
|
|
2110
|
+
#define wc_static_assert(expr) _Static_assert(expr, #expr)
|
|
2111
|
+
#ifndef wc_static_assert2
|
|
2112
|
+
#define wc_static_assert2(expr, msg) _Static_assert(expr, msg)
|
|
2113
|
+
#endif
|
|
2114
|
+
#else
|
|
2115
|
+
#ifdef __COUNTER__
|
|
2116
|
+
#define wc_static_assert(expr) \
|
|
2117
|
+
struct WC_CPP_CAT4(wc_static_assert_dummy_struct_L, \
|
|
2118
|
+
__LINE__, _, __COUNTER__) { \
|
|
2119
|
+
char t[(expr) ? 1 : -1]; \
|
|
2120
|
+
}
|
|
2121
|
+
#else
|
|
2122
|
+
#define wc_static_assert(expr) \
|
|
2123
|
+
struct wc_static_assert_dummy_struct
|
|
2124
|
+
#endif
|
|
2125
|
+
#ifndef wc_static_assert2
|
|
2126
|
+
#define wc_static_assert2(expr, msg) wc_static_assert(expr)
|
|
2127
|
+
#endif
|
|
2128
|
+
#endif
|
|
2129
|
+
#elif !defined(wc_static_assert2)
|
|
2130
|
+
#define wc_static_assert2(expr, msg) wc_static_assert(expr)
|
|
2131
|
+
#endif
|
|
2132
|
+
|
|
2133
|
+
#ifndef WC_RELAX_LONG_LOOP
|
|
2134
|
+
#define WC_RELAX_LONG_LOOP() WC_DO_NOTHING
|
|
2135
|
+
#endif
|
|
2136
|
+
#ifndef WC_CHECK_FOR_INTR_SIGNALS
|
|
2137
|
+
#define WC_CHECK_FOR_INTR_SIGNALS() 0
|
|
2138
|
+
#ifndef SAVE_NO_VECTOR_REGISTERS
|
|
2139
|
+
#define SAVE_NO_VECTOR_REGISTERS(fail_clause) WC_RELAX_LONG_LOOP()
|
|
2140
|
+
#endif
|
|
2141
|
+
#ifndef SAVE_NO_VECTOR_REGISTERS2
|
|
2142
|
+
#define SAVE_NO_VECTOR_REGISTERS2() 0
|
|
2143
|
+
#endif
|
|
2144
|
+
#else
|
|
2145
|
+
#ifndef SAVE_NO_VECTOR_REGISTERS
|
|
2146
|
+
#define SAVE_NO_VECTOR_REGISTERS(fail_clause) { \
|
|
2147
|
+
int _svr_ret = WC_CHECK_FOR_INTR_SIGNALS(); \
|
|
2148
|
+
if (_svr_ret != 0) { fail_clause } \
|
|
2149
|
+
WC_RELAX_LONG_LOOP(); \
|
|
2150
|
+
}
|
|
2151
|
+
#endif
|
|
2152
|
+
#ifndef SAVE_NO_VECTOR_REGISTERS2
|
|
2153
|
+
#define SAVE_NO_VECTOR_REGISTERS2() WC_CHECK_FOR_INTR_SIGNALS()
|
|
2154
|
+
#endif
|
|
2155
|
+
#endif
|
|
2156
|
+
#ifndef WC_SIG_IGNORE_BEGIN
|
|
2157
|
+
#define WC_SIG_IGNORE_BEGIN() 0
|
|
2158
|
+
#endif
|
|
2159
|
+
#ifndef WC_SIG_IGNORE_END
|
|
2160
|
+
#define WC_SIG_IGNORE_END() 0
|
|
2161
|
+
#endif
|
|
2162
|
+
|
|
2163
|
+
#ifndef RESTORE_NO_VECTOR_REGISTERS
|
|
2164
|
+
#define RESTORE_NO_VECTOR_REGISTERS() WC_RELAX_LONG_LOOP()
|
|
2165
|
+
#endif
|
|
2166
|
+
|
|
2167
|
+
#ifndef SAVE_VECTOR_REGISTERS
|
|
2168
|
+
#define SAVE_VECTOR_REGISTERS(fail_clause) SAVE_NO_VECTOR_REGISTERS(fail_clause)
|
|
2169
|
+
#endif
|
|
2170
|
+
#ifndef SAVE_VECTOR_REGISTERS2
|
|
2171
|
+
#define SAVE_VECTOR_REGISTERS2() SAVE_NO_VECTOR_REGISTERS2()
|
|
2172
|
+
#define SAVE_VECTOR_REGISTERS2_DOES_NOTHING /* VECTOR_REGISTERS_{PUSH,POP}
|
|
2173
|
+
* in aes.c depend on this.
|
|
2174
|
+
*/
|
|
2175
|
+
#endif
|
|
2176
|
+
#ifndef CAN_SAVE_VECTOR_REGISTERS
|
|
2177
|
+
#define CAN_SAVE_VECTOR_REGISTERS() 1
|
|
2178
|
+
#define CAN_SAVE_VECTOR_REGISTERS_ALWAYS_TRUE
|
|
2179
|
+
#endif
|
|
2180
|
+
#ifndef WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL
|
|
2181
|
+
#define WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL(x) WC_DO_NOTHING
|
|
2182
|
+
#endif
|
|
2183
|
+
#ifndef ASSERT_SAVED_VECTOR_REGISTERS
|
|
2184
|
+
#define ASSERT_SAVED_VECTOR_REGISTERS() WC_DO_NOTHING
|
|
2185
|
+
#endif
|
|
2186
|
+
#ifndef ASSERT_RESTORED_VECTOR_REGISTERS
|
|
2187
|
+
#define ASSERT_RESTORED_VECTOR_REGISTERS(fail_clause) WC_DO_NOTHING
|
|
2188
|
+
#endif
|
|
2189
|
+
#ifndef RESTORE_VECTOR_REGISTERS
|
|
2190
|
+
#define RESTORE_VECTOR_REGISTERS() RESTORE_NO_VECTOR_REGISTERS()
|
|
2191
|
+
#endif
|
|
2192
|
+
|
|
2193
|
+
#if (defined(USE_INTEL_SPEEDUP) || defined(USE_INTEL_SPEEDUP_FOR_AES) || \
|
|
2194
|
+
defined(WOLFSSL_AESNI) || defined(WOLFSSL_ARMASM) || \
|
|
2195
|
+
defined(WOLFSSL_SP_ASM)) && !defined(WOLFSSL_NO_ASM)
|
|
2196
|
+
#define WC_HAVE_VECTOR_SPEEDUPS
|
|
2197
|
+
#endif
|
|
2198
|
+
|
|
2199
|
+
/* DISABLE_VECTOR_REGISTERS() and REENABLE_VECTOR_REGISTERS() are currently only
|
|
2200
|
+
* used by Linux kernel code. If WC_HAVE_VECTOR_SPEEDUPS, we default
|
|
2201
|
+
* DISABLE_VECTOR_REGISTERS() to -1, to assure calling code is forced to handle
|
|
2202
|
+
* the failure. But if the build disables vec regs globally, we can return 0
|
|
2203
|
+
* harmlessly. The kernel build defines real calls for these in vectorized
|
|
2204
|
+
* builds, otherwise it uses these fallbacks.
|
|
2205
|
+
*/
|
|
2206
|
+
#ifndef DISABLE_VECTOR_REGISTERS
|
|
2207
|
+
#ifdef WC_HAVE_VECTOR_SPEEDUPS
|
|
2208
|
+
#define DISABLE_VECTOR_REGISTERS() (-1)
|
|
2209
|
+
#else
|
|
2210
|
+
#define DISABLE_VECTOR_REGISTERS() 0
|
|
2211
|
+
#endif
|
|
2212
|
+
#endif
|
|
2213
|
+
#ifndef REENABLE_VECTOR_REGISTERS
|
|
2214
|
+
#define REENABLE_VECTOR_REGISTERS() WC_DO_NOTHING
|
|
2215
|
+
#endif
|
|
2216
|
+
|
|
2217
|
+
#ifndef WC_SANITIZE_DISABLE
|
|
2218
|
+
#define WC_SANITIZE_DISABLE() WC_DO_NOTHING
|
|
2219
|
+
#endif
|
|
2220
|
+
#ifndef WC_SANITIZE_ENABLE
|
|
2221
|
+
#define WC_SANITIZE_ENABLE() WC_DO_NOTHING
|
|
2222
|
+
#endif
|
|
2223
|
+
|
|
2224
|
+
#if FIPS_VERSION_GE(5,1)
|
|
2225
|
+
#define WC_SPKRE_F(x,y) wolfCrypt_SetPrivateKeyReadEnable_fips((x),(y))
|
|
2226
|
+
#define PRIVATE_KEY_LOCK() WC_SPKRE_F(0,WC_KEYTYPE_ALL)
|
|
2227
|
+
#define PRIVATE_KEY_UNLOCK() WC_SPKRE_F(1,WC_KEYTYPE_ALL)
|
|
2228
|
+
#else
|
|
2229
|
+
#define PRIVATE_KEY_LOCK() WC_DO_NOTHING
|
|
2230
|
+
#define PRIVATE_KEY_UNLOCK() WC_DO_NOTHING
|
|
2231
|
+
#endif
|
|
2232
|
+
|
|
2233
|
+
|
|
2234
|
+
#ifdef _MSC_VER
|
|
2235
|
+
/* disable buggy MSC warning (incompatible with clang-tidy
|
|
2236
|
+
* readability-avoid-const-params-in-decls)
|
|
2237
|
+
* "warning C4028: formal parameter x different from declaration"
|
|
2238
|
+
*/
|
|
2239
|
+
#pragma warning(disable: 4028)
|
|
2240
|
+
#endif
|
|
2241
|
+
|
|
2242
|
+
|
|
2243
|
+
/* opaque math variable type */
|
|
2244
|
+
#if defined(USE_FAST_MATH)
|
|
2245
|
+
struct fp_int;
|
|
2246
|
+
#define MATH_INT_T struct fp_int
|
|
2247
|
+
#elif defined(USE_INTEGER_HEAP_MATH)
|
|
2248
|
+
struct mp_int;
|
|
2249
|
+
#define MATH_INT_T struct mp_int
|
|
2250
|
+
#else
|
|
2251
|
+
struct sp_int;
|
|
2252
|
+
#define MATH_INT_T struct sp_int
|
|
2253
|
+
#endif
|
|
2254
|
+
|
|
2255
|
+
|
|
2256
|
+
/* Maximum ASN sizes */
|
|
2257
|
+
#ifndef WOLFSSL_ASN_MAX_LENGTH_SZ
|
|
2258
|
+
#define WOLFSSL_ASN_MAX_LENGTH_SZ 5 /* 1 byte length + 4 bytes of number */
|
|
2259
|
+
#endif
|
|
2260
|
+
|
|
2261
|
+
enum Max_ASN {
|
|
2262
|
+
DSA_PUB_INTS = 4, /* DSA ints in public key */
|
|
2263
|
+
DSA_INTS = 5, /* DSA ints in private key */
|
|
2264
|
+
MAX_SALT_SIZE = 64, /* MAX PKCS Salt length */
|
|
2265
|
+
MAX_IV_SIZE = 64, /* MAX PKCS Iv length */
|
|
2266
|
+
#ifdef HAVE_SPHINCS
|
|
2267
|
+
MAX_ENCODED_SIG_SZ = 51200,
|
|
2268
|
+
#elif defined(HAVE_FALCON) || defined(HAVE_DILITHIUM)
|
|
2269
|
+
MAX_ENCODED_SIG_SZ = 5120,
|
|
2270
|
+
#elif !defined(NO_RSA)
|
|
2271
|
+
#if defined(USE_FAST_MATH) && defined(FP_MAX_BITS)
|
|
2272
|
+
MAX_ENCODED_SIG_SZ = FP_MAX_BITS / 8,
|
|
2273
|
+
#elif (defined(WOLFSSL_SP_MATH_ALL) || defined(WOLFSSL_SP_MATH)) && \
|
|
2274
|
+
defined(SP_INT_BITS)
|
|
2275
|
+
MAX_ENCODED_SIG_SZ = (SP_INT_BITS + 7) / 8,
|
|
2276
|
+
#elif defined(WOLFSSL_HAPROXY)
|
|
2277
|
+
MAX_ENCODED_SIG_SZ = 1024, /* Supports 8192 bit keys */
|
|
2278
|
+
#else
|
|
2279
|
+
MAX_ENCODED_SIG_SZ = 512, /* Supports 4096 bit keys */
|
|
2280
|
+
#endif
|
|
2281
|
+
#elif defined(HAVE_ECC)
|
|
2282
|
+
MAX_ENCODED_SIG_SZ = 140,
|
|
2283
|
+
#elif defined(HAVE_CURVE448)
|
|
2284
|
+
MAX_ENCODED_SIG_SZ = 114,
|
|
2285
|
+
#else
|
|
2286
|
+
MAX_ENCODED_SIG_SZ = 64,
|
|
2287
|
+
#endif
|
|
2288
|
+
MAX_ALGO_SZ = 20,
|
|
2289
|
+
MAX_LENGTH_SZ = WOLFSSL_ASN_MAX_LENGTH_SZ, /* Max length size for DER encoding */
|
|
2290
|
+
MAX_SHORT_SZ = (1 + 1 + 5), /* asn int + byte len + 5 byte length */
|
|
2291
|
+
MAX_SEQ_SZ = (1 + MAX_LENGTH_SZ), /* enum(seq | con) + length(5) */
|
|
2292
|
+
MAX_SET_SZ = (1 + MAX_LENGTH_SZ), /* enum(set | con) + length(5) */
|
|
2293
|
+
MAX_OCTET_STR_SZ = (1 + MAX_LENGTH_SZ), /* enum(set | con) + length(5) */
|
|
2294
|
+
MAX_EXP_SZ = (1 + MAX_LENGTH_SZ), /* enum(contextspec|con|exp) + length(5) */
|
|
2295
|
+
MAX_PRSTR_SZ = (1 + MAX_LENGTH_SZ), /* enum(prstr) + length(5) */
|
|
2296
|
+
MAX_VERSION_SZ = 5, /* enum + id + version(byte) + (header(2))*/
|
|
2297
|
+
MAX_ENCODED_DIG_ASN_SZ = (5 + MAX_LENGTH_SZ), /* enum(bit or octet) + length(5) */
|
|
2298
|
+
MAX_ENCODED_DIG_SZ = 64 + MAX_ENCODED_DIG_ASN_SZ, /* asn header + sha512 */
|
|
2299
|
+
MAX_RSA_INT_SZ = (512 + 1 + MAX_LENGTH_SZ), /* RSA raw sz 4096 for bits + tag + len(5) */
|
|
2300
|
+
MAX_DSA_INT_SZ = (384 + 1 + MAX_LENGTH_SZ), /* DSA raw sz 3072 for bits + tag + len(5) */
|
|
2301
|
+
MAX_DSA_PUBKEY_SZ = (DSA_PUB_INTS * MAX_DSA_INT_SZ) + (2 * MAX_SEQ_SZ) +
|
|
2302
|
+
2 + MAX_LENGTH_SZ, /* Maximum size of a DSA public
|
|
2303
|
+
key taken from wc_SetDsaPublicKey. */
|
|
2304
|
+
MAX_DSA_PRIVKEY_SZ = (DSA_INTS * MAX_DSA_INT_SZ) + MAX_SEQ_SZ +
|
|
2305
|
+
MAX_VERSION_SZ, /* Maximum size of a DSA Private
|
|
2306
|
+
key taken from DsaKeyIntsToDer. */
|
|
2307
|
+
#if defined(HAVE_FALCON) || defined(HAVE_DILITHIUM)
|
|
2308
|
+
MAX_PQC_PUBLIC_KEY_SZ = 2592, /* Maximum size of a Dilithium public key. */
|
|
2309
|
+
#endif
|
|
2310
|
+
MAX_RSA_E_SZ = 16, /* Max RSA public e size */
|
|
2311
|
+
MAX_CA_SZ = 32, /* Max encoded CA basic constraint length */
|
|
2312
|
+
MAX_SN_SZ = 35, /* Max encoded serial number (INT) length */
|
|
2313
|
+
MAX_DER_DIGEST_SZ = MAX_ENCODED_DIG_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ,
|
|
2314
|
+
/* Maximum DER digest size */
|
|
2315
|
+
MAX_DER_DIGEST_ASN_SZ = MAX_ENCODED_DIG_ASN_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ,
|
|
2316
|
+
/* Maximum DER digest ASN header size */
|
|
2317
|
+
/* Max X509 header length indicates the
|
|
2318
|
+
* max length + 2 ('\n', '\0') */
|
|
2319
|
+
#if defined(HAVE_FALCON) || defined(HAVE_DILITHIUM) || defined(HAVE_SPHINCS)
|
|
2320
|
+
MAX_X509_HEADER_SZ = (48 + 2), /* Maximum PEM Header/Footer Size */
|
|
2321
|
+
#else
|
|
2322
|
+
MAX_X509_HEADER_SZ = (37 + 2), /* Maximum PEM Header/Footer Size */
|
|
2323
|
+
#endif
|
|
2324
|
+
|
|
2325
|
+
#if defined(HAVE_FALCON) || defined(HAVE_DILITHIUM)
|
|
2326
|
+
MAX_PUBLIC_KEY_SZ = MAX_PQC_PUBLIC_KEY_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ * 2,
|
|
2327
|
+
#else
|
|
2328
|
+
MAX_PUBLIC_KEY_SZ = MAX_DSA_PUBKEY_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ * 2,
|
|
2329
|
+
#endif
|
|
2330
|
+
#ifdef WOLFSSL_ENCRYPTED_KEYS
|
|
2331
|
+
HEADER_ENCRYPTED_KEY_SIZE = 88 /* Extra header size for encrypted key */
|
|
2332
|
+
#else
|
|
2333
|
+
HEADER_ENCRYPTED_KEY_SIZE = 0
|
|
2334
|
+
#endif
|
|
2335
|
+
};
|
|
2336
|
+
|
|
2337
|
+
#ifndef WC_MAX_DIGEST_SIZE
|
|
2338
|
+
#define WC_MAX_DIGEST_SIZE 64
|
|
2339
|
+
#endif
|
|
2340
|
+
#ifndef WC_MAX_BLOCK_SIZE
|
|
2341
|
+
#define WC_MAX_BLOCK_SIZE 128
|
|
2342
|
+
#endif
|
|
2343
|
+
|
|
2344
|
+
#define MAX_SIG_SZ MAX_ENCODED_SIG_SZ
|
|
2345
|
+
|
|
2346
|
+
#ifdef WOLFSSL_CERT_GEN
|
|
2347
|
+
/* Used in asn.c MakeSignature for ECC and RSA non-blocking/async */
|
|
2348
|
+
enum CertSignState {
|
|
2349
|
+
CERTSIGN_STATE_BEGIN,
|
|
2350
|
+
CERTSIGN_STATE_DIGEST,
|
|
2351
|
+
CERTSIGN_STATE_ENCODE,
|
|
2352
|
+
CERTSIGN_STATE_DO
|
|
2353
|
+
};
|
|
2354
|
+
|
|
2355
|
+
typedef struct CertSignCtx {
|
|
2356
|
+
#ifdef WOLFSSL_NO_MALLOC
|
|
2357
|
+
byte sig[MAX_ENCODED_SIG_SZ];
|
|
2358
|
+
byte digest[WC_MAX_DIGEST_SIZE];
|
|
2359
|
+
#ifndef NO_RSA
|
|
2360
|
+
byte encSig[MAX_DER_DIGEST_SZ];
|
|
2361
|
+
#endif
|
|
2362
|
+
#else
|
|
2363
|
+
byte* sig;
|
|
2364
|
+
byte* digest;
|
|
2365
|
+
#ifndef NO_RSA
|
|
2366
|
+
byte* encSig;
|
|
2367
|
+
#endif
|
|
2368
|
+
#endif
|
|
2369
|
+
|
|
2370
|
+
#ifndef NO_RSA
|
|
2371
|
+
int encSigSz;
|
|
2372
|
+
#endif
|
|
2373
|
+
int state; /* enum CertSignState */
|
|
2374
|
+
} CertSignCtx;
|
|
2375
|
+
|
|
2376
|
+
#endif /* WOLFSSL_CERT_GEN */
|
|
2377
|
+
|
|
2378
|
+
|
|
2379
|
+
#ifdef __cplusplus
|
|
2380
|
+
} /* extern "C" */
|
|
2381
|
+
#endif
|
|
2382
|
+
|
|
2383
|
+
#endif /* WOLF_CRYPT_TYPES_H */
|