aws-crt 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/auth.h +1 -0
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/aws_imds_client.h +5 -0
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/credentials.h +5 -0
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/private/aws_signing.h +1 -0
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/private/credentials_utils.h +2 -0
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/signing_config.h +1 -0
- data/aws-crt-ffi/crt/aws-c-auth/source/auth.c +3 -1
- data/aws-crt-ffi/crt/aws-c-auth/source/aws_imds_client.c +146 -63
- data/aws-crt-ffi/crt/aws-c-auth/source/aws_signing.c +41 -19
- data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_imds.c +1 -0
- data/aws-crt-ffi/crt/aws-c-auth/source/credentials_utils.c +1 -0
- data/aws-crt-ffi/crt/aws-c-auth/source/signable_http_request.c +2 -1
- data/aws-crt-ffi/crt/aws-c-auth/source/signing_config.c +25 -0
- data/aws-crt-ffi/crt/aws-c-auth/tests/CMakeLists.txt +3 -0
- data/aws-crt-ffi/crt/aws-c-auth/tests/aws_imds_client_test.c +197 -31
- data/aws-crt-ffi/crt/aws-c-auth/tests/credentials_provider_imds_tests.c +16 -18
- data/aws-crt-ffi/crt/aws-c-auth/tests/sigv4_signing_tests.c +3 -1
- data/aws-crt-ffi/crt/aws-c-cal/include/aws/cal/private/opensslcrypto_common.h +22 -0
- data/aws-crt-ffi/crt/aws-c-cal/source/darwin/commoncrypto_aes.c +46 -17
- data/aws-crt-ffi/crt/aws-c-cal/source/unix/openssl_aes.c +1 -0
- data/aws-crt-ffi/crt/aws-c-cal/source/unix/openssl_platform_init.c +7 -0
- data/aws-crt-ffi/crt/aws-c-cal/source/unix/openssl_rsa.c +59 -2
- data/aws-crt-ffi/crt/aws-c-cal/source/unix/opensslcrypto_ecc.c +1 -0
- data/aws-crt-ffi/crt/aws-c-common/CMakeLists.txt +13 -1
- data/aws-crt-ffi/crt/aws-c-common/THIRD-PARTY-LICENSES.txt +28 -7
- data/aws-crt-ffi/crt/aws-c-common/bin/system_info/CMakeLists.txt +18 -0
- data/aws-crt-ffi/crt/aws-c-common/bin/system_info/print_system_info.c +48 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/allocator.h +23 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/byte_buf.h +12 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/cross_process_lock.h +35 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/hash_table.h +1 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/priority_queue.h +24 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/private/system_info_priv.h +37 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/system_info.h +47 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/system_resource_util.h +30 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/testing/aws_test_harness.h +3 -2
- data/aws-crt-ffi/crt/aws-c-common/source/allocator.c +64 -13
- data/aws-crt-ffi/crt/aws-c-common/source/android/logging.c +14 -0
- data/aws-crt-ffi/crt/aws-c-common/source/common.c +3 -3
- data/aws-crt-ffi/crt/aws-c-common/source/file.c +96 -35
- data/aws-crt-ffi/crt/aws-c-common/source/linux/system_info.c +24 -0
- data/aws-crt-ffi/crt/aws-c-common/source/memtrace.c +10 -3
- data/aws-crt-ffi/crt/aws-c-common/source/platform_fallback_stubs/system_info.c +21 -0
- data/aws-crt-ffi/crt/aws-c-common/source/posix/cross_process_lock.c +141 -0
- data/aws-crt-ffi/crt/aws-c-common/source/posix/system_info.c +1 -1
- data/aws-crt-ffi/crt/aws-c-common/source/posix/system_resource_utils.c +32 -0
- data/aws-crt-ffi/crt/aws-c-common/source/priority_queue.c +24 -0
- data/aws-crt-ffi/crt/aws-c-common/source/system_info.c +80 -0
- data/aws-crt-ffi/crt/aws-c-common/source/task_scheduler.c +2 -2
- data/aws-crt-ffi/crt/aws-c-common/source/windows/cross_process_lock.c +93 -0
- data/aws-crt-ffi/crt/aws-c-common/source/windows/system_resource_utils.c +31 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/CMakeLists.txt +16 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/alloc_test.c +83 -22
- data/aws-crt-ffi/crt/aws-c-common/tests/cross_process_lock_tests.c +116 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/file_test.c +103 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/priority_queue_test.c +36 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/system_info_tests.c +19 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/system_resource_util_test.c +37 -0
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/connection.h +9 -0
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/http.h +1 -0
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/connection_impl.h +5 -4
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/connection_manager_system_vtable.h +10 -18
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/proxy_impl.h +5 -1
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/request_response_impl.h +5 -0
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/request_response.h +10 -0
- data/aws-crt-ffi/crt/aws-c-http/source/connection.c +5 -2
- data/aws-crt-ffi/crt/aws-c-http/source/connection_manager.c +22 -21
- data/aws-crt-ffi/crt/aws-c-http/source/h1_connection.c +102 -17
- data/aws-crt-ffi/crt/aws-c-http/source/h1_stream.c +1 -0
- data/aws-crt-ffi/crt/aws-c-http/source/http.c +3 -0
- data/aws-crt-ffi/crt/aws-c-http/source/proxy_connection.c +2 -2
- data/aws-crt-ffi/crt/aws-c-http/tests/CMakeLists.txt +2 -0
- data/aws-crt-ffi/crt/aws-c-http/tests/test_connection_manager.c +18 -18
- data/aws-crt-ffi/crt/aws-c-http/tests/test_h1_client.c +111 -1
- data/aws-crt-ffi/crt/aws-c-http/tests/test_proxy.c +2 -2
- data/aws-crt-ffi/crt/aws-c-http/tests/test_stream_manager.c +2 -2
- data/aws-crt-ffi/crt/aws-c-io/include/aws/io/retry_strategy.h +1 -1
- data/aws-crt-ffi/crt/aws-c-io/source/exponential_backoff_retry_strategy.c +1 -1
- data/aws-crt-ffi/crt/aws-c-io/source/pkcs11_tls_op_handler.c +2 -4
- data/aws-crt-ffi/crt/aws-lc/CMakeLists.txt +16 -8
- data/aws-crt-ffi/crt/aws-lc/cmake/go.cmake +6 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/CMakeLists.txt +6 -9
- data/aws-crt-ffi/crt/aws-lc/crypto/asn1/a_time.c +34 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/asn1/a_utctm.c +4 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/asn1/asn1_test.cc +41 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/bio_mem.c +6 -7
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/bio_test.cc +152 -16
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/connect.c +6 -12
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/fd.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/file.c +20 -8
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/socket.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/socket_helper.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/blake2/blake2.c +11 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/bytestring/cbb.c +13 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/bytestring/cbs.c +9 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/chacha/asm/chacha-armv8.pl +1 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/chacha/chacha.c +49 -8
- data/aws-crt-ffi/crt/aws-lc/crypto/chacha/chacha_test.cc +110 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/chacha/internal.h +8 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/compiler_test.cc +4 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/conf/conf_test.cc +1 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/crypto_test.cc +9 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/curve25519.c +189 -108
- data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/curve25519_nohw.c +78 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/ed25519_test.cc +9 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/internal.h +24 -10
- data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/spake25519.c +4 -4
- data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/x25519_test.cc +80 -11
- data/aws-crt-ffi/crt/aws-lc/crypto/decrepit/evp/evp_do_all.c +2 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/digest_extra/digest_extra.c +8 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/digest_extra/digest_test.cc +110 -45
- data/aws-crt-ffi/crt/aws-lc/crypto/dsa/dsa_test.cc +8 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/dsa/internal.h +18 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/dynamic_loading_test.c +8 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/ec_extra/ec_derive.c +4 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/ec_extra/hash_to_curve.c +6 -18
- data/aws-crt-ffi/crt/aws-lc/crypto/endian_test.cc +308 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/err/ssl.errordata +2 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/evp_extra_test.cc +2 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/evp_test.cc +11 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/evp_tests.txt +25 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/p_ec_asn1.c +1 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/p_kem.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/p_rsa_asn1.c +1 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/print.c +7 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/scrypt.c +13 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/CMakeLists.txt +13 -4
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/aes/aes_nohw.c +18 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bcm.c +12 -4
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/bn_assert_test.cc +77 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/bn_test.cc +30 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/bytes.c +112 -22
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/div.c +12 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/exponentiation.c +54 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/gcd.c +5 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/internal.h +37 -15
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/montgomery.c +4 -11
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/montgomery_inv.c +51 -15
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/cipher/aead.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/digest/digest.c +29 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/digest/digests.c +89 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/digest/internal.h +4 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/ec.c +19 -36
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/ec_key.c +3 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/ec_montgomery.c +9 -7
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/ec_test.cc +33 -9
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/internal.h +17 -12
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p224-64.c +5 -8
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p256-nistz.c +8 -8
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p256.c +9 -8
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p384.c +33 -16
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p521.c +14 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/scalar.c +26 -24
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/simple_mul.c +8 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/wnaf.c +3 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ecdsa/ecdsa.c +9 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/evp/evp.c +43 -12
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/evp/p_ec.c +4 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/hmac/hmac.c +3 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/modes/xts.c +26 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rand/cpu_jitter_test.cc +1 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rand/internal.h +20 -11
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rand/rand.c +10 -10
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rand/urandom.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rsa/internal.h +59 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rsa/padding.c +9 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rsa/rsa.c +7 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rsa/rsa_impl.c +51 -60
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/service_indicator/service_indicator.c +5 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/service_indicator/service_indicator_test.cc +205 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/asm/sha1-armv8.pl +1 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/asm/sha512-armv8.pl +1 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/internal.h +8 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha3.c +37 -15
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha3_test.cc +115 -110
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha512.c +55 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sshkdf/sshkdf.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/hmac_extra/hmac_test.cc +12 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/hmac_extra/hmac_tests.txt +10 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/hrss/asm/poly_rq_mul.S +2 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/impl_dispatch_test.cc +9 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/internal.h +90 -8
- data/aws-crt-ffi/crt/aws-lc/crypto/kem/kem.c +28 -27
- data/aws-crt-ffi/crt/aws-lc/crypto/kyber/kem_kyber.h +14 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/obj/obj_dat.h +52 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/obj/obj_mac.num +5 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/obj/objects.txt +7 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/perlasm/arm-xlate.pl +3 -14
- data/aws-crt-ffi/crt/aws-lc/crypto/perlasm/ppc-xlate.pl +1 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/perlasm/x86_64-xlate.pl +4 -15
- data/aws-crt-ffi/crt/aws-lc/crypto/perlasm/x86asm.pl +4 -13
- data/aws-crt-ffi/crt/aws-lc/crypto/poly1305/poly1305_arm_asm.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/crypto/rand_extra/deterministic.c +4 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/rand_extra/fuchsia.c +4 -4
- data/aws-crt-ffi/crt/aws-lc/crypto/rand_extra/rand_test.cc +0 -63
- data/aws-crt-ffi/crt/aws-lc/crypto/rand_extra/windows.c +41 -19
- data/aws-crt-ffi/crt/aws-lc/crypto/rsa_extra/rsa_test.cc +3 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/siphash/siphash.c +12 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/siphash/siphash_test.cc +5 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/stack/stack.c +68 -46
- data/aws-crt-ffi/crt/aws-lc/crypto/trust_token/pmbtoken.c +4 -4
- data/aws-crt-ffi/crt/aws-lc/crypto/trust_token/voprf.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/x509/by_dir.c +0 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/x509/internal.h +4 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/x509/x509_lu.c +33 -9
- data/aws-crt-ffi/crt/aws-lc/crypto/x509/x509_test.cc +87 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/x509/x509_trs.c +1 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/x509/x509_vfy.c +35 -13
- data/aws-crt-ffi/crt/aws-lc/crypto/x509v3/v3_lib.c +2 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/x509v3/v3_purp.c +4 -6
- data/aws-crt-ffi/crt/aws-lc/generated-src/crypto_test_data.cc +179 -151
- data/aws-crt-ffi/crt/aws-lc/generated-src/err_data.c +353 -349
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/chacha/chacha-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/cipher_extra/chacha20_poly1305_armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/aesv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/aesv8-gcm-armv8-unroll8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/aesv8-gcm-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/armv8-mont.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/bn-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/ghash-neon-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/ghashv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/keccak1600-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/md5-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/p256-armv8-asm.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/p256_beeu-armv8-asm.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/sha1-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/sha256-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/sha512-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/vpaes-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/test/trampoline-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/chacha/chacha-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/aesv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/armv4-mont.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/bsaes-armv7.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/ghash-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/ghashv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/sha1-armv4-large.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/sha256-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/sha512-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/vpaes-armv7.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/test/trampoline-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/chacha/chacha-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/cipher_extra/chacha20_poly1305_armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/aesv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/aesv8-gcm-armv8-unroll8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/aesv8-gcm-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/armv8-mont.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/bn-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/ghashv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/keccak1600-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/md5-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/p256-armv8-asm.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/p256_beeu-armv8-asm.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/sha1-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/sha256-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/sha512-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/vpaes-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/test/trampoline-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/chacha/chacha-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/aesv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/armv4-mont.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/bsaes-armv7.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/ghash-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/ghashv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/sha1-armv4-large.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/sha256-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/sha512-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/vpaes-armv7.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/test/trampoline-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-ppc64le/crypto/fipsmodule/aesp8-ppc.S +1 -5
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-ppc64le/crypto/fipsmodule/ghashp8-ppc.S +1 -5
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-ppc64le/crypto/test/trampoline-ppc.S +1 -5
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/chacha/chacha-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/aesni-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/bn-586.S +4 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/co-586.S +4 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/ghash-ssse3-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/ghash-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/md5-586.S +4 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/sha1-586.S +4 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/sha256-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/sha512-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/vpaes-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/x86-mont.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/test/trampoline-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/chacha/chacha-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/cipher_extra/aesni-sha1-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/cipher_extra/aesni-sha256-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-gcm-avx512.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-xts-avx512.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/md5-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/rsaz-avx2.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/sha1-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/x86_64-mont.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/test/trampoline-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/chacha/chacha-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/aesni-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/bn-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/co-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/ghash-ssse3-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/ghash-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/md5-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/sha1-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/sha256-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/sha512-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/vpaes-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/x86-mont.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/test/trampoline-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/chacha/chacha-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/cipher_extra/aesni-sha1-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/cipher_extra/aesni-sha256-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/aesni-gcm-avx512.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/aesni-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/aesni-xts-avx512.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/ghash-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/md5-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/rdrand-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/rsaz-avx2.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/sha1-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/sha256-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/sha512-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/vpaes-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/x86_64-mont.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/x86_64-mont5.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/test/trampoline-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/chacha/chacha-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/cipher_extra/chacha20_poly1305_armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/aesv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/aesv8-gcm-armv8-unroll8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/aesv8-gcm-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/armv8-mont.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/bn-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/ghash-neon-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/ghashv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/keccak1600-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/md5-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/p256-armv8-asm.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/p256_beeu-armv8-asm.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/sha1-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/sha256-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/sha512-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/vpaes-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/test/trampoline-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/go.mod +4 -4
- data/aws-crt-ffi/crt/aws-lc/go.sum +8 -10
- data/aws-crt-ffi/crt/aws-lc/include/openssl/aead.h +2 -2
- data/aws-crt-ffi/crt/aws-lc/include/openssl/arm_arch.h +4 -119
- data/aws-crt-ffi/crt/aws-lc/include/openssl/asm_base.h +185 -0
- data/aws-crt-ffi/crt/aws-lc/include/openssl/asn1.h +5 -0
- data/aws-crt-ffi/crt/aws-lc/include/openssl/base.h +31 -134
- data/aws-crt-ffi/crt/aws-lc/include/openssl/bio.h +30 -18
- data/aws-crt-ffi/crt/aws-lc/include/openssl/bn.h +0 -2
- data/aws-crt-ffi/crt/aws-lc/include/openssl/chacha.h +6 -0
- data/aws-crt-ffi/crt/aws-lc/include/openssl/cipher.h +2 -2
- data/aws-crt-ffi/crt/aws-lc/include/openssl/digest.h +9 -6
- data/aws-crt-ffi/crt/aws-lc/include/openssl/dsa.h +0 -21
- data/aws-crt-ffi/crt/aws-lc/include/openssl/ec.h +1 -1
- data/aws-crt-ffi/crt/aws-lc/include/openssl/err.h +1 -1
- data/aws-crt-ffi/crt/aws-lc/include/openssl/evp.h +8 -5
- data/aws-crt-ffi/crt/aws-lc/include/openssl/nid.h +21 -0
- data/aws-crt-ffi/crt/aws-lc/include/openssl/rsa.h +1 -65
- data/aws-crt-ffi/crt/aws-lc/include/openssl/sha.h +22 -1
- data/aws-crt-ffi/crt/aws-lc/include/openssl/ssl.h +121 -13
- data/aws-crt-ffi/crt/aws-lc/include/openssl/stack.h +229 -208
- data/aws-crt-ffi/crt/aws-lc/include/openssl/target.h +166 -0
- data/aws-crt-ffi/crt/aws-lc/include/openssl/x509.h +30 -10
- data/aws-crt-ffi/crt/aws-lc/include/openssl/x509v3.h +6 -4
- data/aws-crt-ffi/crt/aws-lc/sources.cmake +2 -0
- data/aws-crt-ffi/crt/aws-lc/ssl/extensions.cc +12 -7
- data/aws-crt-ffi/crt/aws-lc/ssl/handshake_server.cc +28 -18
- data/aws-crt-ffi/crt/aws-lc/ssl/internal.h +41 -6
- data/aws-crt-ffi/crt/aws-lc/ssl/s3_both.cc +9 -17
- data/aws-crt-ffi/crt/aws-lc/ssl/ssl_cipher.cc +13 -5
- data/aws-crt-ffi/crt/aws-lc/ssl/ssl_key_share.cc +542 -2
- data/aws-crt-ffi/crt/aws-lc/ssl/ssl_lib.cc +35 -0
- data/aws-crt-ffi/crt/aws-lc/ssl/ssl_test.cc +1847 -14
- data/aws-crt-ffi/crt/aws-lc/ssl/ssl_x509.cc +128 -0
- data/aws-crt-ffi/crt/aws-lc/ssl/test/PORTING.md +10 -7
- data/aws-crt-ffi/crt/aws-lc/ssl/test/bssl_shim.cc +133 -77
- data/aws-crt-ffi/crt/aws-lc/ssl/test/handshake_util.cc +3 -3
- data/aws-crt-ffi/crt/aws-lc/ssl/test/handshaker.cc +4 -0
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/handshake_client.go +6 -2
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/handshake_messages.go +894 -1042
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/handshake_server.go +24 -23
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/prf.go +6 -5
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/runner.go +56 -55
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/shim_dispatcher.go +188 -0
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/ticket.go +37 -39
- data/aws-crt-ffi/crt/aws-lc/ssl/test/test_config.cc +59 -24
- data/aws-crt-ffi/crt/aws-lc/ssl/test/test_config.h +3 -2
- data/aws-crt-ffi/crt/aws-lc/ssl/tls13_server.cc +10 -11
- data/aws-crt-ffi/crt/aws-lc/tests/ci/cdk/app.py +4 -4
- data/aws-crt-ffi/crt/aws-lc/tests/ci/cdk/cdk/{aws_lc_mac_arm_ci_stack.py → aws_lc_ec2_test_framework_ci_stack.py} +13 -29
- data/aws-crt-ffi/crt/aws-lc/tests/ci/cdk/cdk/ssm/general_test_run_ssm_document.yaml +43 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/common_posix_setup.sh +10 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-aarch/amazonlinux-2023_base/Dockerfile +5 -1
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-aarch/ubuntu-22.04_base/Dockerfile +19 -3
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/amazonlinux-2_gcc-7x-intel-sde/Dockerfile +5 -4
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/build_images.sh +1 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/push_images.sh +2 -1
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/ubuntu-20.04_clang-10x_formal-verification/create_image.sh +1 -1
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/ubuntu-22.04_base/Dockerfile +1 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/ubuntu-22.04_clang-14x-sde/Dockerfile +42 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/windows/vs2017/Dockerfile +14 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/windows/windows_base/Dockerfile +3 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/README.md +12 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/nginx_patch/aws-lc-nginx.patch +68 -23
- data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/run_crt_integration.sh +27 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/run_monit_integration.sh +56 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/sslproxy_patch/aws-lc-sslproxy.patch +2 -2
- data/aws-crt-ffi/crt/aws-lc/tests/ci/run_ec2_test_framework.sh +135 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/run_fips_tests.sh +14 -2
- data/aws-crt-ffi/crt/aws-lc/tests/ci/run_tests_with_sde.sh +4 -1
- data/aws-crt-ffi/crt/aws-lc/tests/ci/run_tests_with_sde_asan.sh +14 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/run_windows_tests.bat +39 -3
- data/aws-crt-ffi/crt/aws-lc/third_party/fiat/README.md +21 -6
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_madd_n25519.S +284 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_madd_n25519_alt.S +210 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_mod_n25519.S +186 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_neg_p25519.S +65 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519.S +1043 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519_alt.S +1043 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519_byte.S +1043 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519_byte_alt.S +1043 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519base.S +1042 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519base_alt.S +1042 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519base_byte.S +1042 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519base_byte_alt.S +1043 -354
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_decode.S +700 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_decode_alt.S +563 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_encode.S +131 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_scalarmulbase.S +9626 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_scalarmulbase_alt.S +9468 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_scalarmuldouble.S +3157 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_scalarmuldouble_alt.S +2941 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/p384/Makefile +1 -1
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/p521/Makefile +1 -1
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/include/s2n-bignum_aws-lc.h +34 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/bignum_madd_n25519.S +219 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/bignum_madd_n25519_alt.S +245 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/bignum_mod_n25519.S +228 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/bignum_neg_p25519.S +86 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/curve25519_x25519.S +1350 -407
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/curve25519_x25519_alt.S +1350 -407
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/curve25519_x25519base.S +1344 -400
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/curve25519_x25519base_alt.S +1348 -402
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_decode.S +670 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_decode_alt.S +751 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_encode.S +81 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_scalarmulbase.S +9910 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_scalarmulbase_alt.S +9986 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_scalarmuldouble.S +3619 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_scalarmuldouble_alt.S +3736 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/wycheproof_testvectors/hmac_sha512_224_test.json +1978 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/wycheproof_testvectors/hmac_sha512_224_test.txt +1403 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/wycheproof_testvectors/hmac_sha512_256_test.json +1993 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/wycheproof_testvectors/hmac_sha512_256_test.txt +1416 -0
- data/aws-crt-ffi/crt/aws-lc/tool/digest.cc +4 -0
- data/aws-crt-ffi/crt/aws-lc/tool/internal.h +1 -0
- data/aws-crt-ffi/crt/aws-lc/tool/speed.cc +53 -6
- data/aws-crt-ffi/crt/aws-lc/util/all_tests.go +43 -12
- data/aws-crt-ffi/crt/aws-lc/util/all_tests.json +13 -5
- data/aws-crt-ffi/crt/aws-lc/util/bot/DEPS +4 -4
- data/aws-crt-ffi/crt/aws-lc/util/bot/update_clang.py +8 -2
- data/aws-crt-ffi/crt/aws-lc/util/codecov-ci.sh +82 -0
- data/aws-crt-ffi/crt/aws-lc/util/convert_wycheproof/convert_wycheproof.go +7 -5
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/ACVP.md +7 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/subprocess/hash.go +24 -9
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/subprocess/rsa.go +3 -4
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/subprocess/subprocess.go +15 -10
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/expected/HMAC-SHA2-512-224.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/expected/SHA2-512-224.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/expected/SHAKE-128.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/expected/SHAKE-256.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/sha-tests/sha512-224-tests.json +1 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/sha-tests/shake-128-tests.json +1 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/sha-tests/shake-256-tests.json +1 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/tests.json +1 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/vectors/HMAC-SHA2-512-224.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/vectors/SHA2-512-224.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/vectors/SHAKE-128.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/vectors/SHAKE-256.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/modulewrapper/main.cc +4 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/modulewrapper/modulewrapper.cc +144 -1
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/delocate/delocate.go +9 -3
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/delocate/testdata/aarch64-Basic/in.s +4 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/delocate/testdata/aarch64-Basic/out.s +11 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/inject_hash/inject_hash.go +13 -4
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/test-break-kat.sh +2 -0
- data/aws-crt-ffi/crt/aws-lc/util/testconfig/testconfig.go +2 -1
- data/aws-crt-ffi/crt/s2n/api/s2n.h +9 -5
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/benches/handshake.rs +9 -6
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/benches/resumption.rs +14 -14
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/benches/throughput.rs +9 -6
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/src/harness.rs +106 -102
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/src/openssl.rs +24 -20
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/src/rustls.rs +28 -24
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/src/s2n_tls.rs +52 -50
- data/aws-crt-ffi/crt/s2n/bindings/rust/generate/Cargo.toml +1 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/integration/Cargo.toml +3 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls/Cargo.toml +2 -2
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls/src/connection.rs +9 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-sys/templates/Cargo.template +2 -1
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/Cargo.toml +2 -2
- data/aws-crt-ffi/crt/s2n/tests/cbmc/sources/make_common_datastructures.c +9 -2
- data/aws-crt-ffi/crt/s2n/tests/fuzz/s2n_client_cert_verify_recv_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/fuzz/s2n_hybrid_ecdhe_kyber_r3_fuzz_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/fuzz/s2n_tls13_cert_verify_recv_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_version_negotiation.py +4 -4
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_auth_selection_test.c +19 -9
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_auth_handshake_test.c +3 -3
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_cert_verify_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_hello_recv_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_hello_test.c +4 -4
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_signature_algorithms_extension_test.c +4 -5
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_connection_protocol_versions_test.c +390 -0
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_connection_test.c +8 -4
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_handshake_test.c +2 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_quic_support_io_test.c +106 -0
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_security_policies_test.c +6 -2
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_self_talk_offload_signing_test.c +3 -3
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_self_talk_session_resumption_test.c +135 -0
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_server_new_session_ticket_test.c +32 -0
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_server_signature_algorithms_extension_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_signature_algorithms_test.c +307 -283
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_cert_request_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_cert_verify_test.c +18 -17
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_x509_validator_test.c +125 -0
- data/aws-crt-ffi/crt/s2n/tls/extensions/s2n_client_signature_algorithms.c +8 -1
- data/aws-crt-ffi/crt/s2n/tls/extensions/s2n_client_supported_versions.c +43 -11
- data/aws-crt-ffi/crt/s2n/tls/extensions/s2n_client_supported_versions.h +3 -0
- data/aws-crt-ffi/crt/s2n/tls/extensions/s2n_server_signature_algorithms.c +8 -1
- data/aws-crt-ffi/crt/s2n/tls/s2n_auth_selection.c +4 -2
- data/aws-crt-ffi/crt/s2n/tls/s2n_client_cert_verify.c +7 -10
- data/aws-crt-ffi/crt/s2n/tls/s2n_client_hello.c +2 -2
- data/aws-crt-ffi/crt/s2n/tls/s2n_connection.c +75 -14
- data/aws-crt-ffi/crt/s2n/tls/s2n_handshake.h +2 -2
- data/aws-crt-ffi/crt/s2n/tls/s2n_post_handshake.c +1 -1
- data/aws-crt-ffi/crt/s2n/tls/s2n_post_handshake.h +1 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_quic_support.c +29 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_quic_support.h +5 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_security_policies.c +40 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_security_policies.h +4 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_server_cert_request.c +1 -1
- data/aws-crt-ffi/crt/s2n/tls/s2n_server_hello.c +0 -3
- data/aws-crt-ffi/crt/s2n/tls/s2n_server_key_exchange.c +8 -9
- data/aws-crt-ffi/crt/s2n/tls/s2n_server_new_session_ticket.c +8 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_signature_algorithms.c +111 -72
- data/aws-crt-ffi/crt/s2n/tls/s2n_signature_algorithms.h +11 -9
- data/aws-crt-ffi/crt/s2n/tls/s2n_signature_scheme.c +9 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_signature_scheme.h +2 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_tls13_certificate_verify.c +12 -18
- data/aws-crt-ffi/crt/s2n/tls/s2n_x509_validator.c +7 -7
- data/aws-crt-ffi/src/api.h +1 -0
- data/lib/aws-crt/native.rb +1 -1
- metadata +68 -5
- data/aws-crt-ffi/crt/aws-lc/tests/ci/cdk/cdk/ssm/m1_tests_ssm_document.yaml +0 -34
- data/aws-crt-ffi/crt/aws-lc/tests/ci/run_m1_ec2_instance.sh +0 -96
@@ -0,0 +1,563 @@
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
+
// SPDX-License-Identifier: Apache-2.0 OR ISC
|
3
|
+
|
4
|
+
// ----------------------------------------------------------------------------
|
5
|
+
// Decode compressed 256-bit form of edwards25519 point
|
6
|
+
// Input c[32] (bytes); output function return and z[8]
|
7
|
+
//
|
8
|
+
// extern uint64_t edwards25519_decode_alt(uint64_t z[static 8],uint8_t c[static 32]);
|
9
|
+
//
|
10
|
+
// This interprets the input byte string as a little-endian number
|
11
|
+
// representing a point (x,y) on the edwards25519 curve, encoded as
|
12
|
+
// 2^255 * x_0 + y where x_0 is the least significant bit of x. It
|
13
|
+
// returns the full pair of coordinates x (at z) and y (at z+4). The
|
14
|
+
// return code is 0 for success and 1 for failure, which means that
|
15
|
+
// the input does not correspond to the encoding of any edwards25519
|
16
|
+
// point. This can happen for three reasons, where y = the lowest
|
17
|
+
// 255 bits of the input:
|
18
|
+
//
|
19
|
+
// * y >= p_25519
|
20
|
+
// Input y coordinate is not reduced
|
21
|
+
// * (y^2 - 1) * (1 + d_25519 * y^2) has no modular square root
|
22
|
+
// There is no x such that (x,y) is on the curve
|
23
|
+
// * y^2 = 1 and top bit of input is set
|
24
|
+
// Cannot be the canonical encoding of (0,1) or (0,-1)
|
25
|
+
//
|
26
|
+
// Standard ARM ABI: X0 = z, X1 = c
|
27
|
+
// ----------------------------------------------------------------------------
|
28
|
+
#include "_internal_s2n_bignum.h"
|
29
|
+
|
30
|
+
S2N_BN_SYM_VISIBILITY_DIRECTIVE(edwards25519_decode_alt)
|
31
|
+
S2N_BN_SYM_PRIVACY_DIRECTIVE(edwards25519_decode_alt)
|
32
|
+
|
33
|
+
.text
|
34
|
+
.balign 4
|
35
|
+
|
36
|
+
// Size in bytes of a 64-bit word
|
37
|
+
|
38
|
+
#define N 8
|
39
|
+
|
40
|
+
// Pointer-offset pairs for temporaries on stack
|
41
|
+
|
42
|
+
#define y sp, #0
|
43
|
+
#define s sp, #(4*N)
|
44
|
+
#define t sp, #(8*N)
|
45
|
+
#define u sp, #(12*N)
|
46
|
+
#define v sp, #(16*N)
|
47
|
+
#define w sp, #(20*N)
|
48
|
+
|
49
|
+
// Other temporary variables in register
|
50
|
+
|
51
|
+
#define res x19
|
52
|
+
#define sgnbit x20
|
53
|
+
#define badun x21
|
54
|
+
|
55
|
+
// Total size to reserve on the stack
|
56
|
+
|
57
|
+
#define NSPACE #(24*N)
|
58
|
+
|
59
|
+
// Loading large constants
|
60
|
+
|
61
|
+
#define movbig(nn,n3,n2,n1,n0) \
|
62
|
+
movz nn, n0; \
|
63
|
+
movk nn, n1, lsl #16; \
|
64
|
+
movk nn, n2, lsl #32; \
|
65
|
+
movk nn, n3, lsl #48
|
66
|
+
|
67
|
+
// Macros wrapping up calls to the local subroutines
|
68
|
+
|
69
|
+
#define mulp(dest,src1,src2) \
|
70
|
+
add x0, dest; \
|
71
|
+
add x1, src1; \
|
72
|
+
add x2, src2; \
|
73
|
+
bl edwards25519_decode_alt_mul_p25519
|
74
|
+
|
75
|
+
#define nsqr(dest,n,src) \
|
76
|
+
add x0, dest; \
|
77
|
+
mov x1, n; \
|
78
|
+
add x2, src; \
|
79
|
+
bl edwards25519_decode_alt_nsqr_p25519
|
80
|
+
|
81
|
+
S2N_BN_SYMBOL(edwards25519_decode_alt):
|
82
|
+
|
83
|
+
// Save registers and make room for temporaries
|
84
|
+
|
85
|
+
stp x19, x20, [sp, -16]!
|
86
|
+
stp x21, x30, [sp, -16]!
|
87
|
+
sub sp, sp, NSPACE
|
88
|
+
|
89
|
+
// Save the return pointer for the end so we can overwrite x0 later
|
90
|
+
|
91
|
+
mov res, x0
|
92
|
+
|
93
|
+
// Load the inputs, using byte operations in case of big-endian setting.
|
94
|
+
// Let y be the lowest 255 bits of the input and sgnbit the desired parity.
|
95
|
+
// If y >= p_25519 then already flag the input as invalid (badun = 1).
|
96
|
+
|
97
|
+
ldrb w0, [x1]
|
98
|
+
lsl x4, x0, #56
|
99
|
+
ldrb w0, [x1, #1]
|
100
|
+
extr x4, x0, x4, #8
|
101
|
+
ldrb w0, [x1, #2]
|
102
|
+
extr x4, x0, x4, #8
|
103
|
+
ldrb w0, [x1, #3]
|
104
|
+
extr x4, x0, x4, #8
|
105
|
+
ldrb w0, [x1, #4]
|
106
|
+
extr x4, x0, x4, #8
|
107
|
+
ldrb w0, [x1, #5]
|
108
|
+
extr x4, x0, x4, #8
|
109
|
+
ldrb w0, [x1, #6]
|
110
|
+
extr x4, x0, x4, #8
|
111
|
+
ldrb w0, [x1, #7]
|
112
|
+
extr x4, x0, x4, #8
|
113
|
+
|
114
|
+
ldrb w0, [x1, #8]
|
115
|
+
lsl x5, x0, #56
|
116
|
+
ldrb w0, [x1, #9]
|
117
|
+
extr x5, x0, x5, #8
|
118
|
+
ldrb w0, [x1, #10]
|
119
|
+
extr x5, x0, x5, #8
|
120
|
+
ldrb w0, [x1, #11]
|
121
|
+
extr x5, x0, x5, #8
|
122
|
+
ldrb w0, [x1, #12]
|
123
|
+
extr x5, x0, x5, #8
|
124
|
+
ldrb w0, [x1, #13]
|
125
|
+
extr x5, x0, x5, #8
|
126
|
+
ldrb w0, [x1, #14]
|
127
|
+
extr x5, x0, x5, #8
|
128
|
+
ldrb w0, [x1, #15]
|
129
|
+
extr x5, x0, x5, #8
|
130
|
+
|
131
|
+
ldrb w0, [x1, #16]
|
132
|
+
lsl x6, x0, #56
|
133
|
+
ldrb w0, [x1, #17]
|
134
|
+
extr x6, x0, x6, #8
|
135
|
+
ldrb w0, [x1, #18]
|
136
|
+
extr x6, x0, x6, #8
|
137
|
+
ldrb w0, [x1, #19]
|
138
|
+
extr x6, x0, x6, #8
|
139
|
+
ldrb w0, [x1, #20]
|
140
|
+
extr x6, x0, x6, #8
|
141
|
+
ldrb w0, [x1, #21]
|
142
|
+
extr x6, x0, x6, #8
|
143
|
+
ldrb w0, [x1, #22]
|
144
|
+
extr x6, x0, x6, #8
|
145
|
+
ldrb w0, [x1, #23]
|
146
|
+
extr x6, x0, x6, #8
|
147
|
+
|
148
|
+
ldrb w0, [x1, #24]
|
149
|
+
lsl x7, x0, #56
|
150
|
+
ldrb w0, [x1, #25]
|
151
|
+
extr x7, x0, x7, #8
|
152
|
+
ldrb w0, [x1, #26]
|
153
|
+
extr x7, x0, x7, #8
|
154
|
+
ldrb w0, [x1, #27]
|
155
|
+
extr x7, x0, x7, #8
|
156
|
+
ldrb w0, [x1, #28]
|
157
|
+
extr x7, x0, x7, #8
|
158
|
+
ldrb w0, [x1, #29]
|
159
|
+
extr x7, x0, x7, #8
|
160
|
+
ldrb w0, [x1, #30]
|
161
|
+
extr x7, x0, x7, #8
|
162
|
+
ldrb w0, [x1, #31]
|
163
|
+
extr x7, x0, x7, #8
|
164
|
+
|
165
|
+
stp x4, x5, [y]
|
166
|
+
lsr sgnbit, x7, #63
|
167
|
+
and x7, x7, #0x7FFFFFFFFFFFFFFF
|
168
|
+
stp x6, x7, [y+16]
|
169
|
+
|
170
|
+
adds xzr, x4, #19
|
171
|
+
adcs xzr, x5, xzr
|
172
|
+
adcs xzr, x6, xzr
|
173
|
+
adcs xzr, x7, xzr
|
174
|
+
cset badun, mi
|
175
|
+
|
176
|
+
// u = y^2 - 1 (actually y + 2^255-20, not reduced modulo)
|
177
|
+
// v = 1 + d * y^2 (not reduced modulo from the +1)
|
178
|
+
// w = u * v
|
179
|
+
|
180
|
+
nsqr(v,1,y)
|
181
|
+
ldp x0, x1, [v]
|
182
|
+
ldp x2, x3, [v+16]
|
183
|
+
mov x4, #0x8000000000000000
|
184
|
+
subs x0, x0, #20
|
185
|
+
sbcs x1, x1, xzr
|
186
|
+
sbcs x2, x2, xzr
|
187
|
+
sbc x3, x3, x4
|
188
|
+
stp x0, x1, [u]
|
189
|
+
stp x2, x3, [u+16]
|
190
|
+
|
191
|
+
movbig(x0,#0x75eb,#0x4dca,#0x1359,#0x78a3)
|
192
|
+
movbig(x1,#0x0070,#0x0a4d,#0x4141,#0xd8ab)
|
193
|
+
movbig(x2,#0x8cc7,#0x4079,#0x7779,#0xe898)
|
194
|
+
movbig(x3,#0x5203,#0x6cee,#0x2b6f,#0xfe73)
|
195
|
+
stp x0, x1, [w]
|
196
|
+
stp x2, x3, [w+16]
|
197
|
+
mulp(v,w,v)
|
198
|
+
ldp x0, x1, [v]
|
199
|
+
ldp x2, x3, [v+16]
|
200
|
+
adds x0, x0, #1
|
201
|
+
adcs x1, x1, xzr
|
202
|
+
adcs x2, x2, xzr
|
203
|
+
adcs x3, x3, xzr
|
204
|
+
stp x0, x1, [v]
|
205
|
+
stp x2, x3, [v+16]
|
206
|
+
|
207
|
+
mulp(w,u,v)
|
208
|
+
|
209
|
+
// Get s = w^{252-3} as a candidate inverse square root 1/sqrt(w).
|
210
|
+
// This power tower computation is the same as bignum_invsqrt_p25519
|
211
|
+
|
212
|
+
nsqr(t,1,w)
|
213
|
+
mulp(t,t,w)
|
214
|
+
nsqr(s,2,t)
|
215
|
+
mulp(t,s,t)
|
216
|
+
nsqr(s,1,t)
|
217
|
+
mulp(v,s,w)
|
218
|
+
nsqr(s,5,v)
|
219
|
+
mulp(t,s,v)
|
220
|
+
nsqr(s,10,t)
|
221
|
+
mulp(t,s,t)
|
222
|
+
nsqr(s,5,t)
|
223
|
+
mulp(v,s,v)
|
224
|
+
nsqr(s,25,v)
|
225
|
+
mulp(t,s,v)
|
226
|
+
nsqr(s,50,t)
|
227
|
+
mulp(t,s,t)
|
228
|
+
nsqr(s,25,t)
|
229
|
+
mulp(v,s,v)
|
230
|
+
nsqr(s,125,v)
|
231
|
+
mulp(v,s,v)
|
232
|
+
nsqr(s,2,v)
|
233
|
+
mulp(s,s,w)
|
234
|
+
|
235
|
+
// Compute v' = s^2 * w to discriminate whether the square root sqrt(u/v)
|
236
|
+
// exists, in which case we should get 0, 1 or -1.
|
237
|
+
|
238
|
+
nsqr(v,1,s)
|
239
|
+
mulp(v,v,w)
|
240
|
+
|
241
|
+
// Get the two candidates for sqrt(u / v), one being s = u * w^{252-3}
|
242
|
+
// and the other being t = s * j_25519 where j_25519 = sqrt(-1).
|
243
|
+
|
244
|
+
mulp(s,u,s)
|
245
|
+
movbig(x0, #0xc4ee, #0x1b27, #0x4a0e, #0xa0b0)
|
246
|
+
movbig(x1, #0x2f43, #0x1806, #0xad2f, #0xe478)
|
247
|
+
movbig(x2, #0x2b4d, #0x0099, #0x3dfb, #0xd7a7)
|
248
|
+
movbig(x3, #0x2b83, #0x2480, #0x4fc1, #0xdf0b)
|
249
|
+
stp x0, x1, [t]
|
250
|
+
stp x2, x3, [t+16]
|
251
|
+
mulp(t,s,t)
|
252
|
+
|
253
|
+
// x4 = 0 <=> s^2 * w = 0 or 1
|
254
|
+
|
255
|
+
ldp x0, x1, [v]
|
256
|
+
ldp x2, x3, [v+16]
|
257
|
+
bic x4, x0, #1
|
258
|
+
orr x4, x4, x1
|
259
|
+
orr x5, x2, x3
|
260
|
+
orr x4, x4, x5
|
261
|
+
|
262
|
+
// x0 = 0 <=> s^2 * w = -1 (mod p_25519, i.e. s^2 * w = 2^255 - 20)
|
263
|
+
|
264
|
+
add x0, x0, #20
|
265
|
+
add x1, x1, #1
|
266
|
+
orr x0, x0, x1
|
267
|
+
add x2, x2, #1
|
268
|
+
eor x3, x3, #0x7FFFFFFFFFFFFFFF
|
269
|
+
orr x2, x2, x3
|
270
|
+
orr x0, x0, x2
|
271
|
+
|
272
|
+
// If s^2 * w is not 0 or 1 then replace s by t
|
273
|
+
|
274
|
+
cmp x4, xzr
|
275
|
+
ldp x10, x11, [s]
|
276
|
+
ldp x14, x15, [t]
|
277
|
+
csel x10, x10, x14, eq
|
278
|
+
csel x11, x11, x15, eq
|
279
|
+
ldp x12, x13, [s+16]
|
280
|
+
ldp x16, x17, [t+16]
|
281
|
+
csel x12, x12, x16, eq
|
282
|
+
csel x13, x13, x17, eq
|
283
|
+
stp x10, x11, [s]
|
284
|
+
stp x12, x13, [s+16]
|
285
|
+
|
286
|
+
// Check invalidity, occurring if s^2 * w is not in {0,1,-1}
|
287
|
+
|
288
|
+
ccmp x0, xzr, 4, ne
|
289
|
+
cset x0, ne
|
290
|
+
orr badun, badun, x0
|
291
|
+
|
292
|
+
// Let [x3;x2;x1;x0] = s and [x7;x6;x5;x4] = p_25519 - s
|
293
|
+
|
294
|
+
ldp x0, x1, [s]
|
295
|
+
ldp x2, x3, [s+16]
|
296
|
+
mov x4, #-19
|
297
|
+
subs x4, x4, x0
|
298
|
+
mov x6, #-1
|
299
|
+
sbcs x5, x6, x1
|
300
|
+
sbcs x6, x6, x2
|
301
|
+
mov x7, #0x7FFFFFFFFFFFFFFF
|
302
|
+
sbc x7, x7, x3
|
303
|
+
|
304
|
+
// Decide whether a flip is apparently indicated, s_0 <=> sgnbit
|
305
|
+
// Decide also if s = 0 by OR-ing its digits. Now if a flip is indicated:
|
306
|
+
// - if s = 0 then mark as invalid
|
307
|
+
// - if s <> 0 then indeed flip
|
308
|
+
|
309
|
+
and x9, x0, #1
|
310
|
+
eor sgnbit, x9, sgnbit
|
311
|
+
orr x8, x0, x1
|
312
|
+
orr x9, x2, x3
|
313
|
+
orr x8, x8, x9
|
314
|
+
orr x10, badun, sgnbit
|
315
|
+
cmp x8, xzr
|
316
|
+
csel badun, x10, badun, eq
|
317
|
+
ccmp sgnbit, xzr, #4, ne
|
318
|
+
|
319
|
+
// Actual selection of x as s or -s, copying of y and return of validity
|
320
|
+
|
321
|
+
csel x0, x0, x4, eq
|
322
|
+
csel x1, x1, x5, eq
|
323
|
+
csel x2, x2, x6, eq
|
324
|
+
csel x3, x3, x7, eq
|
325
|
+
ldp x8, x9, [y]
|
326
|
+
ldp x10, x11, [y+16]
|
327
|
+
|
328
|
+
stp x0, x1, [res]
|
329
|
+
stp x2, x3, [res, #16]
|
330
|
+
stp x8, x9, [res, #32]
|
331
|
+
stp x10, x11, [res, #48]
|
332
|
+
|
333
|
+
mov x0, badun
|
334
|
+
|
335
|
+
// Restore stack and registers
|
336
|
+
|
337
|
+
add sp, sp, NSPACE
|
338
|
+
|
339
|
+
ldp x21, x30, [sp], 16
|
340
|
+
ldp x19, x20, [sp], 16
|
341
|
+
ret
|
342
|
+
|
343
|
+
// *************************************************************
|
344
|
+
// Local z = x * y
|
345
|
+
// *************************************************************
|
346
|
+
|
347
|
+
edwards25519_decode_alt_mul_p25519:
|
348
|
+
ldp x3, x4, [x1]
|
349
|
+
ldp x7, x8, [x2]
|
350
|
+
mul x12, x3, x7
|
351
|
+
umulh x13, x3, x7
|
352
|
+
mul x11, x3, x8
|
353
|
+
umulh x14, x3, x8
|
354
|
+
adds x13, x13, x11
|
355
|
+
ldp x9, x10, [x2, #16]
|
356
|
+
mul x11, x3, x9
|
357
|
+
umulh x15, x3, x9
|
358
|
+
adcs x14, x14, x11
|
359
|
+
mul x11, x3, x10
|
360
|
+
umulh x16, x3, x10
|
361
|
+
adcs x15, x15, x11
|
362
|
+
adc x16, x16, xzr
|
363
|
+
ldp x5, x6, [x1, #16]
|
364
|
+
mul x11, x4, x7
|
365
|
+
adds x13, x13, x11
|
366
|
+
mul x11, x4, x8
|
367
|
+
adcs x14, x14, x11
|
368
|
+
mul x11, x4, x9
|
369
|
+
adcs x15, x15, x11
|
370
|
+
mul x11, x4, x10
|
371
|
+
adcs x16, x16, x11
|
372
|
+
umulh x3, x4, x10
|
373
|
+
adc x3, x3, xzr
|
374
|
+
umulh x11, x4, x7
|
375
|
+
adds x14, x14, x11
|
376
|
+
umulh x11, x4, x8
|
377
|
+
adcs x15, x15, x11
|
378
|
+
umulh x11, x4, x9
|
379
|
+
adcs x16, x16, x11
|
380
|
+
adc x3, x3, xzr
|
381
|
+
mul x11, x5, x7
|
382
|
+
adds x14, x14, x11
|
383
|
+
mul x11, x5, x8
|
384
|
+
adcs x15, x15, x11
|
385
|
+
mul x11, x5, x9
|
386
|
+
adcs x16, x16, x11
|
387
|
+
mul x11, x5, x10
|
388
|
+
adcs x3, x3, x11
|
389
|
+
umulh x4, x5, x10
|
390
|
+
adc x4, x4, xzr
|
391
|
+
umulh x11, x5, x7
|
392
|
+
adds x15, x15, x11
|
393
|
+
umulh x11, x5, x8
|
394
|
+
adcs x16, x16, x11
|
395
|
+
umulh x11, x5, x9
|
396
|
+
adcs x3, x3, x11
|
397
|
+
adc x4, x4, xzr
|
398
|
+
mul x11, x6, x7
|
399
|
+
adds x15, x15, x11
|
400
|
+
mul x11, x6, x8
|
401
|
+
adcs x16, x16, x11
|
402
|
+
mul x11, x6, x9
|
403
|
+
adcs x3, x3, x11
|
404
|
+
mul x11, x6, x10
|
405
|
+
adcs x4, x4, x11
|
406
|
+
umulh x5, x6, x10
|
407
|
+
adc x5, x5, xzr
|
408
|
+
umulh x11, x6, x7
|
409
|
+
adds x16, x16, x11
|
410
|
+
umulh x11, x6, x8
|
411
|
+
adcs x3, x3, x11
|
412
|
+
umulh x11, x6, x9
|
413
|
+
adcs x4, x4, x11
|
414
|
+
adc x5, x5, xzr
|
415
|
+
mov x7, #38
|
416
|
+
mul x11, x7, x16
|
417
|
+
umulh x9, x7, x16
|
418
|
+
adds x12, x12, x11
|
419
|
+
mul x11, x7, x3
|
420
|
+
umulh x3, x7, x3
|
421
|
+
adcs x13, x13, x11
|
422
|
+
mul x11, x7, x4
|
423
|
+
umulh x4, x7, x4
|
424
|
+
adcs x14, x14, x11
|
425
|
+
mul x11, x7, x5
|
426
|
+
umulh x5, x7, x5
|
427
|
+
adcs x15, x15, x11
|
428
|
+
cset x16, hs
|
429
|
+
adds x15, x15, x4
|
430
|
+
adc x16, x16, x5
|
431
|
+
cmn x15, x15
|
432
|
+
orr x15, x15, #0x8000000000000000
|
433
|
+
adc x8, x16, x16
|
434
|
+
mov x7, #19
|
435
|
+
madd x11, x7, x8, x7
|
436
|
+
adds x12, x12, x11
|
437
|
+
adcs x13, x13, x9
|
438
|
+
adcs x14, x14, x3
|
439
|
+
adcs x15, x15, xzr
|
440
|
+
csel x7, x7, xzr, lo
|
441
|
+
subs x12, x12, x7
|
442
|
+
sbcs x13, x13, xzr
|
443
|
+
sbcs x14, x14, xzr
|
444
|
+
sbc x15, x15, xzr
|
445
|
+
and x15, x15, #0x7fffffffffffffff
|
446
|
+
stp x12, x13, [x0]
|
447
|
+
stp x14, x15, [x0, #16]
|
448
|
+
ret
|
449
|
+
|
450
|
+
// *************************************************************
|
451
|
+
// Local z = 2^n * x
|
452
|
+
// *************************************************************
|
453
|
+
|
454
|
+
edwards25519_decode_alt_nsqr_p25519:
|
455
|
+
|
456
|
+
// Copy input argument into [x5;x4;x3;x2] (overwriting input pointer x20
|
457
|
+
|
458
|
+
ldp x6, x3, [x2]
|
459
|
+
ldp x4, x5, [x2, #16]
|
460
|
+
mov x2, x6
|
461
|
+
|
462
|
+
// Main squaring loop, accumulating in [x5;x4;x3;x2] consistently and
|
463
|
+
// only ensuring the intermediates are < 2 * p_25519 = 2^256 - 38
|
464
|
+
|
465
|
+
edwards25519_decode_alt_loop:
|
466
|
+
mul x9, x2, x3
|
467
|
+
umulh x10, x2, x3
|
468
|
+
mul x11, x2, x5
|
469
|
+
umulh x12, x2, x5
|
470
|
+
mul x7, x2, x4
|
471
|
+
umulh x6, x2, x4
|
472
|
+
adds x10, x10, x7
|
473
|
+
adcs x11, x11, x6
|
474
|
+
mul x7, x3, x4
|
475
|
+
umulh x6, x3, x4
|
476
|
+
adc x6, x6, xzr
|
477
|
+
adds x11, x11, x7
|
478
|
+
mul x13, x4, x5
|
479
|
+
umulh x14, x4, x5
|
480
|
+
adcs x12, x12, x6
|
481
|
+
mul x7, x3, x5
|
482
|
+
umulh x6, x3, x5
|
483
|
+
adc x6, x6, xzr
|
484
|
+
adds x12, x12, x7
|
485
|
+
adcs x13, x13, x6
|
486
|
+
adc x14, x14, xzr
|
487
|
+
adds x9, x9, x9
|
488
|
+
adcs x10, x10, x10
|
489
|
+
adcs x11, x11, x11
|
490
|
+
adcs x12, x12, x12
|
491
|
+
adcs x13, x13, x13
|
492
|
+
adcs x14, x14, x14
|
493
|
+
cset x6, hs
|
494
|
+
umulh x7, x2, x2
|
495
|
+
mul x8, x2, x2
|
496
|
+
adds x9, x9, x7
|
497
|
+
mul x7, x3, x3
|
498
|
+
adcs x10, x10, x7
|
499
|
+
umulh x7, x3, x3
|
500
|
+
adcs x11, x11, x7
|
501
|
+
mul x7, x4, x4
|
502
|
+
adcs x12, x12, x7
|
503
|
+
umulh x7, x4, x4
|
504
|
+
adcs x13, x13, x7
|
505
|
+
mul x7, x5, x5
|
506
|
+
adcs x14, x14, x7
|
507
|
+
umulh x7, x5, x5
|
508
|
+
adc x6, x6, x7
|
509
|
+
mov x3, #38
|
510
|
+
mul x7, x3, x12
|
511
|
+
umulh x4, x3, x12
|
512
|
+
adds x8, x8, x7
|
513
|
+
mul x7, x3, x13
|
514
|
+
umulh x13, x3, x13
|
515
|
+
adcs x9, x9, x7
|
516
|
+
mul x7, x3, x14
|
517
|
+
umulh x14, x3, x14
|
518
|
+
adcs x10, x10, x7
|
519
|
+
mul x7, x3, x6
|
520
|
+
umulh x6, x3, x6
|
521
|
+
adcs x11, x11, x7
|
522
|
+
cset x12, hs
|
523
|
+
adds x11, x11, x14
|
524
|
+
adc x12, x12, x6
|
525
|
+
cmn x11, x11
|
526
|
+
bic x11, x11, #0x8000000000000000
|
527
|
+
adc x2, x12, x12
|
528
|
+
mov x3, #0x13
|
529
|
+
mul x7, x3, x2
|
530
|
+
adds x2, x8, x7
|
531
|
+
adcs x3, x9, x4
|
532
|
+
adcs x4, x10, x13
|
533
|
+
adc x5, x11, xzr
|
534
|
+
|
535
|
+
// Loop as applicable
|
536
|
+
|
537
|
+
subs x1, x1, #1
|
538
|
+
bne edwards25519_decode_alt_loop
|
539
|
+
|
540
|
+
// We know the intermediate result x < 2^256 - 38, and now we do strict
|
541
|
+
// modular reduction mod 2^255 - 19. Note x < 2^255 - 19 <=> x + 19 < 2^255
|
542
|
+
// which is equivalent to a "pl" condition.
|
543
|
+
|
544
|
+
adds x6, x2, #19
|
545
|
+
adcs x7, x3, xzr
|
546
|
+
adcs x8, x4, xzr
|
547
|
+
adcs x9, x5, xzr
|
548
|
+
|
549
|
+
csel x2, x2, x6, pl
|
550
|
+
csel x3, x3, x7, pl
|
551
|
+
csel x4, x4, x8, pl
|
552
|
+
csel x5, x5, x9, pl
|
553
|
+
bic x5, x5, #0x8000000000000000
|
554
|
+
|
555
|
+
// Copy result back into destination and return
|
556
|
+
|
557
|
+
stp x2, x3, [x0]
|
558
|
+
stp x4, x5, [x0, #16]
|
559
|
+
ret
|
560
|
+
|
561
|
+
#if defined(__linux__) && defined(__ELF__)
|
562
|
+
.section .note.GNU-stack, "", %progbits
|
563
|
+
#endif
|
@@ -0,0 +1,131 @@
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
+
// SPDX-License-Identifier: Apache-2.0 OR ISC
|
3
|
+
|
4
|
+
// ----------------------------------------------------------------------------
|
5
|
+
// Encode edwards25519 point into compressed form as 256-bit number
|
6
|
+
// Input p[8]; output z[32] (bytes)
|
7
|
+
//
|
8
|
+
// extern void edwards25519_encode
|
9
|
+
// (uint8_t z[static 32], uint64_t p[static 8]);
|
10
|
+
//
|
11
|
+
// This assumes that the input buffer p points to a pair of 256-bit
|
12
|
+
// numbers x (at p) and y (at p+4) representing a point (x,y) on the
|
13
|
+
// edwards25519 curve. It is assumed that both x and y are < p_25519
|
14
|
+
// but there is no checking of this, nor of the fact that (x,y) is
|
15
|
+
// in fact on the curve.
|
16
|
+
//
|
17
|
+
// The output in z is a little-endian array of bytes corresponding to
|
18
|
+
// the standard compressed encoding of a point as 2^255 * x_0 + y
|
19
|
+
// where x_0 is the least significant bit of x.
|
20
|
+
// See "https://datatracker.ietf.org/doc/html/rfc8032#section-5.1.2"
|
21
|
+
// In this implementation, y is simply truncated to 255 bits, but if
|
22
|
+
// it is reduced mod p_25519 as expected this does not affect values.
|
23
|
+
//
|
24
|
+
// Standard ARM ABI: X0 = z, X1 = p
|
25
|
+
// ----------------------------------------------------------------------------
|
26
|
+
#include "_internal_s2n_bignum.h"
|
27
|
+
|
28
|
+
S2N_BN_SYM_VISIBILITY_DIRECTIVE(edwards25519_encode)
|
29
|
+
S2N_BN_SYM_PRIVACY_DIRECTIVE(edwards25519_encode)
|
30
|
+
.text
|
31
|
+
.balign 4
|
32
|
+
|
33
|
+
#define z x0
|
34
|
+
#define p x1
|
35
|
+
|
36
|
+
#define y0 x2
|
37
|
+
#define y1 x3
|
38
|
+
#define y2 x4
|
39
|
+
#define y3 x5
|
40
|
+
#define y0short w2
|
41
|
+
#define y1short w3
|
42
|
+
#define y2short w4
|
43
|
+
#define y3short w5
|
44
|
+
#define xb x6
|
45
|
+
|
46
|
+
S2N_BN_SYMBOL(edwards25519_encode):
|
47
|
+
|
48
|
+
// Load lowest word of x coordinate in xb and full y as [y3;y2;y1;y0].
|
49
|
+
|
50
|
+
ldr xb, [p]
|
51
|
+
ldp y0, y1, [p, #32]
|
52
|
+
ldp y2, y3, [p, #48]
|
53
|
+
|
54
|
+
// Compute the encoded form, making the LSB of x the MSB of the encoding
|
55
|
+
|
56
|
+
and y3, y3, #0x7FFFFFFFFFFFFFFF
|
57
|
+
orr y3, y3, xb, lsl #63
|
58
|
+
|
59
|
+
// Write back in a byte-oriented fashion to be independent of endianness
|
60
|
+
|
61
|
+
strb y0short, [z]
|
62
|
+
lsr y0, y0, #8
|
63
|
+
strb y0short, [z, #1]
|
64
|
+
lsr y0, y0, #8
|
65
|
+
strb y0short, [z, #2]
|
66
|
+
lsr y0, y0, #8
|
67
|
+
strb y0short, [z, #3]
|
68
|
+
lsr y0, y0, #8
|
69
|
+
strb y0short, [z, #4]
|
70
|
+
lsr y0, y0, #8
|
71
|
+
strb y0short, [z, #5]
|
72
|
+
lsr y0, y0, #8
|
73
|
+
strb y0short, [z, #6]
|
74
|
+
lsr y0, y0, #8
|
75
|
+
strb y0short, [z, #7]
|
76
|
+
|
77
|
+
strb y1short, [z, #8]
|
78
|
+
lsr y1, y1, #8
|
79
|
+
strb y1short, [z, #9]
|
80
|
+
lsr y1, y1, #8
|
81
|
+
strb y1short, [z, #10]
|
82
|
+
lsr y1, y1, #8
|
83
|
+
strb y1short, [z, #11]
|
84
|
+
lsr y1, y1, #8
|
85
|
+
strb y1short, [z, #12]
|
86
|
+
lsr y1, y1, #8
|
87
|
+
strb y1short, [z, #13]
|
88
|
+
lsr y1, y1, #8
|
89
|
+
strb y1short, [z, #14]
|
90
|
+
lsr y1, y1, #8
|
91
|
+
strb y1short, [z, #15]
|
92
|
+
|
93
|
+
strb y2short, [z, #16]
|
94
|
+
lsr y2, y2, #8
|
95
|
+
strb y2short, [z, #17]
|
96
|
+
lsr y2, y2, #8
|
97
|
+
strb y2short, [z, #18]
|
98
|
+
lsr y2, y2, #8
|
99
|
+
strb y2short, [z, #19]
|
100
|
+
lsr y2, y2, #8
|
101
|
+
strb y2short, [z, #20]
|
102
|
+
lsr y2, y2, #8
|
103
|
+
strb y2short, [z, #21]
|
104
|
+
lsr y2, y2, #8
|
105
|
+
strb y2short, [z, #22]
|
106
|
+
lsr y2, y2, #8
|
107
|
+
strb y2short, [z, #23]
|
108
|
+
|
109
|
+
strb y3short, [z, #24]
|
110
|
+
lsr y3, y3, #8
|
111
|
+
strb y3short, [z, #25]
|
112
|
+
lsr y3, y3, #8
|
113
|
+
strb y3short, [z, #26]
|
114
|
+
lsr y3, y3, #8
|
115
|
+
strb y3short, [z, #27]
|
116
|
+
lsr y3, y3, #8
|
117
|
+
strb y3short, [z, #28]
|
118
|
+
lsr y3, y3, #8
|
119
|
+
strb y3short, [z, #29]
|
120
|
+
lsr y3, y3, #8
|
121
|
+
strb y3short, [z, #30]
|
122
|
+
lsr y3, y3, #8
|
123
|
+
strb y3short, [z, #31]
|
124
|
+
|
125
|
+
// Return
|
126
|
+
|
127
|
+
ret
|
128
|
+
|
129
|
+
#if defined(__linux__) && defined(__ELF__)
|
130
|
+
.section .note.GNU-stack,"",%progbits
|
131
|
+
#endif
|