grpc 1.69.0 → 1.70.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +251 -249
- data/include/grpc/support/atm.h +0 -13
- data/src/core/call/request_buffer.cc +224 -0
- data/src/core/call/request_buffer.h +192 -0
- data/src/core/client_channel/client_channel.cc +2 -3
- data/src/core/client_channel/client_channel_args.h +21 -0
- data/src/core/client_channel/client_channel_filter.h +1 -3
- data/src/core/client_channel/retry_interceptor.cc +406 -0
- data/src/core/client_channel/retry_interceptor.h +157 -0
- data/src/core/client_channel/retry_service_config.h +13 -0
- data/src/core/client_channel/retry_throttle.cc +33 -18
- data/src/core/client_channel/retry_throttle.h +3 -3
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +596 -94
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +189 -13
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_security.cc +1 -3
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +40 -1
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb.h +3 -1
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +66 -36
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +19 -17
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb.h +116 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.c +31 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +67 -6
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +12 -8
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_cmsg_headers.upb.h +151 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_cmsg_headers.upb_minitable.c +60 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_cmsg_headers.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb.h +228 -21
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.c +65 -17
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.h +6 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb.h +7 -106
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.c +7 -28
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.h +0 -2
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +85 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +25 -3
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb.h +2 -1
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +152 -0
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +40 -10
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +135 -4
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +41 -9
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/config/trace/v3/trace.upb.h +0 -2
- data/src/core/ext/upb-gen/envoy/config/trace/v3/trace.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/envoy/config/trace/v3/trace.upb_minitable.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +16 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +3 -2
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +60 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb_minitable.c +13 -2
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +102 -24
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.c +28 -19
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb.h +251 -18
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.c +41 -16
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb.h +2 -1
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/config_dump_shared.upbdefs.c +11 -10
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.c +418 -413
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.c +161 -153
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.c +267 -261
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/socket_cmsg_headers.upbdefs.c +46 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/socket_cmsg_headers.upbdefs.h +33 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/socket_option.upbdefs.c +29 -19
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/socket_option.upbdefs.h +15 -0
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener_components.upbdefs.c +58 -65
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener_components.upbdefs.h +0 -5
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/quic_config.upbdefs.c +73 -63
- data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.c +49 -48
- data/src/core/ext/upbdefs-gen/envoy/config/rbac/v3/rbac.upbdefs.c +117 -100
- data/src/core/ext/upbdefs-gen/envoy/config/rbac/v3/rbac.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.c +905 -897
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/trace.upbdefs.c +15 -18
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +460 -457
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upbdefs.c +16 -19
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +95 -95
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +202 -191
- data/src/core/ext/upbdefs-gen/envoy/service/discovery/v3/discovery.upbdefs.c +148 -135
- data/src/core/ext/upbdefs-gen/envoy/service/discovery/v3/discovery.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/service/status/v3/csds.upbdefs.c +23 -22
- data/src/core/filter/filter_args.h +112 -0
- data/src/core/handshaker/http_connect/http_connect_handshaker.cc +1 -1
- data/src/core/lib/channel/promise_based_filter.h +5 -79
- data/src/core/lib/debug/trace_flags.cc +2 -0
- data/src/core/lib/debug/trace_flags.h +1 -0
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +14 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +7 -2
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +0 -2
- data/src/core/lib/event_engine/windows/windows_engine.cc +1 -0
- data/src/core/lib/experiments/experiments.cc +90 -39
- data/src/core/lib/experiments/experiments.h +43 -24
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +1 -1
- data/src/core/lib/promise/activity.cc +2 -0
- data/src/core/lib/promise/activity.h +29 -8
- data/src/core/lib/promise/map.h +42 -0
- data/src/core/lib/promise/party.cc +36 -1
- data/src/core/lib/promise/party.h +13 -5
- data/src/core/lib/promise/sleep.h +1 -0
- data/src/core/lib/promise/status_flag.h +10 -0
- data/src/core/lib/resource_quota/arena.h +8 -0
- data/src/core/lib/resource_quota/connection_quota.h +4 -0
- data/src/core/lib/surface/call_utils.h +2 -0
- data/src/core/lib/surface/client_call.cc +43 -35
- data/src/core/lib/surface/client_call.h +5 -0
- data/src/core/lib/surface/event_string.cc +7 -1
- data/src/core/lib/surface/init_internally.h +13 -2
- data/src/core/lib/surface/server_call.cc +100 -85
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/call_filters.cc +10 -4
- data/src/core/lib/transport/call_filters.h +8 -0
- data/src/core/lib/transport/call_spine.cc +36 -71
- data/src/core/lib/transport/call_spine.h +131 -7
- data/src/core/lib/transport/call_state.h +132 -39
- data/src/core/lib/transport/interception_chain.cc +8 -0
- data/src/core/lib/transport/interception_chain.h +9 -0
- data/src/core/load_balancing/endpoint_list.cc +10 -0
- data/src/core/load_balancing/endpoint_list.h +13 -6
- data/src/core/load_balancing/lb_policy.h +0 -8
- data/src/core/load_balancing/pick_first/pick_first.cc +89 -56
- data/src/core/load_balancing/ring_hash/ring_hash.cc +158 -70
- data/src/core/load_balancing/ring_hash/ring_hash.h +4 -11
- data/src/core/load_balancing/round_robin/round_robin.cc +9 -14
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +12 -15
- data/src/core/resolver/dns/c_ares/dns_resolver_ares.cc +4 -4
- data/src/core/resolver/xds/xds_dependency_manager.cc +139 -135
- data/src/core/resolver/xds/xds_dependency_manager.h +24 -18
- data/src/core/resolver/xds/xds_resolver.cc +28 -47
- data/src/core/server/server.cc +290 -24
- data/src/core/server/server.h +199 -61
- data/src/core/server/xds_server_config_fetcher.cc +78 -142
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +1 -1
- data/src/core/util/backoff.cc +15 -4
- data/src/core/util/http_client/httpcli.cc +66 -18
- data/src/core/util/http_client/httpcli.h +14 -4
- data/src/core/util/matchers.h +5 -10
- data/src/core/util/ref_counted.h +1 -0
- data/src/core/util/ref_counted_ptr.h +1 -1
- data/src/core/util/useful.h +9 -11
- data/src/core/xds/grpc/xds_endpoint_parser.cc +54 -23
- data/src/core/xds/grpc/xds_metadata.h +8 -0
- data/src/core/xds/xds_client/xds_api.cc +0 -223
- data/src/core/xds/xds_client/xds_api.h +1 -133
- data/src/core/xds/xds_client/xds_client.cc +599 -466
- data/src/core/xds/xds_client/xds_client.h +107 -26
- data/src/core/xds/xds_client/xds_resource_type_impl.h +10 -5
- data/src/ruby/ext/grpc/extconf.rb +1 -0
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_bitstr.c → a_bitstr.cc} +3 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_d2i_fp.c → a_d2i_fp.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_dup.c → a_dup.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_i2d_fp.c → a_i2d_fp.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_int.c → a_int.cc} +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_mbstr.c → a_mbstr.cc} +9 -7
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_object.c → a_object.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_strnid.c → a_strnid.cc} +7 -4
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_type.c → a_type.cc} +4 -4
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{asn1_lib.c → asn1_lib.cc} +4 -4
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{asn_pack.c → asn_pack.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{posix_time.c → posix_time.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{tasn_dec.c → tasn_dec.cc} +4 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{tasn_enc.c → tasn_enc.cc} +9 -6
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{tasn_fre.c → tasn_fre.cc} +14 -20
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{tasn_new.c → tasn_new.cc} +7 -6
- data/third_party/boringssl-with-bazel/src/crypto/asn1/{tasn_utl.c → tasn_utl.cc} +13 -10
- data/third_party/boringssl-with-bazel/src/crypto/base64/{base64.c → base64.cc} +9 -12
- data/third_party/boringssl-with-bazel/src/crypto/bcm_support.h +7 -1
- data/third_party/boringssl-with-bazel/src/crypto/bio/{bio.c → bio.cc} +32 -58
- data/third_party/boringssl-with-bazel/src/crypto/bio/{bio_mem.c → bio_mem.cc} +8 -7
- data/third_party/boringssl-with-bazel/src/crypto/bio/{connect.c → connect.cc} +24 -16
- data/third_party/boringssl-with-bazel/src/crypto/bio/{file.c → file.cc} +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/bio/{pair.c → pair.cc} +22 -20
- data/third_party/boringssl-with-bazel/src/crypto/bio/{printf.c → printf.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/bio/{socket_helper.c → socket_helper.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/blake2/{blake2.c → blake2.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/bn_extra/{bn_asn1.c → bn_asn1.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/bn_extra/{convert.c → convert.cc} +21 -21
- data/third_party/boringssl-with-bazel/src/crypto/buf/{buf.c → buf.cc} +6 -3
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/{asn1_compat.c → asn1_compat.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/{ber.c → ber.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/{cbb.c → cbb.cc} +33 -49
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/{cbs.c → cbs.cc} +20 -27
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/{unicode.c → unicode.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/chacha/{chacha.c → chacha.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/chacha/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/{e_aesctrhmac.c → e_aesctrhmac.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/{e_aesgcmsiv.c → e_aesgcmsiv.cc} +23 -26
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/{e_chacha20poly1305.c → e_chacha20poly1305.cc} +1 -8
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/{e_des.c → e_des.cc} +61 -49
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/{e_null.c → e_null.cc} +12 -9
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/{e_rc2.c → e_rc2.cc} +23 -19
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/{e_rc4.c → e_rc4.cc} +10 -8
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/{e_tls.c → e_tls.cc} +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/conf/{conf.c → conf.cc} +17 -14
- data/third_party/boringssl-with-bazel/src/crypto/conf/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/{cpu_aarch64_apple.c → cpu_aarch64_apple.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/{cpu_aarch64_fuchsia.c → cpu_aarch64_fuchsia.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/{cpu_aarch64_linux.c → cpu_aarch64_linux.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/{cpu_aarch64_openbsd.c → cpu_aarch64_openbsd.cc} +4 -4
- data/third_party/boringssl-with-bazel/src/crypto/{cpu_aarch64_sysreg.c → cpu_aarch64_sysreg.cc} +3 -2
- data/third_party/boringssl-with-bazel/src/crypto/{cpu_aarch64_win.c → cpu_aarch64_win.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/{cpu_arm_freebsd.c → cpu_arm_freebsd.cc} +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/{cpu_arm_linux.c → cpu_arm_linux.cc} +5 -5
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_linux.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/{cpu_intel.c → cpu_intel.cc} +47 -32
- data/third_party/boringssl-with-bazel/src/crypto/{crypto.c → crypto.cc} +6 -11
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/{curve25519.c → curve25519.cc} +28 -31
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/{curve25519_64_adx.c → curve25519_64_adx.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519_tables.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/{spake25519.c → spake25519.cc} +20 -16
- data/third_party/boringssl-with-bazel/src/crypto/dh_extra/{dh_asn1.c → dh_asn1.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/digest_extra/{digest_extra.c → digest_extra.cc} +113 -31
- data/third_party/boringssl-with-bazel/src/crypto/dsa/{dsa.c → dsa.cc} +153 -154
- data/third_party/boringssl-with-bazel/src/crypto/dsa/{dsa_asn1.c → dsa_asn1.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/dsa/internal.h +1 -3
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/{ec_asn1.c → ec_asn1.cc} +35 -0
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/{ec_derive.c → ec_derive.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/{hash_to_curve.c → hash_to_curve.cc} +66 -64
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/ecdsa_extra/{ecdsa_asn1.c → ecdsa_asn1.cc} +15 -25
- data/third_party/boringssl-with-bazel/src/crypto/engine/{engine.c → engine.cc} +12 -8
- data/third_party/boringssl-with-bazel/src/crypto/err/{err.c → err.cc} +24 -27
- data/third_party/boringssl-with-bazel/src/crypto/err/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/evp/{evp.c → evp.cc} +8 -9
- data/third_party/boringssl-with-bazel/src/crypto/evp/{evp_ctx.c → evp_ctx.cc} +7 -8
- data/third_party/boringssl-with-bazel/src/crypto/evp/{p_dh.c → p_dh.cc} +23 -14
- data/third_party/boringssl-with-bazel/src/crypto/evp/{p_dh_asn1.c → p_dh_asn1.cc} +38 -21
- data/third_party/boringssl-with-bazel/src/crypto/evp/{p_dsa_asn1.c → p_dsa_asn1.cc} +19 -24
- data/third_party/boringssl-with-bazel/src/crypto/evp/{p_ec.c → p_ec.cc} +20 -23
- data/third_party/boringssl-with-bazel/src/crypto/evp/{p_ec_asn1.c → p_ec_asn1.cc} +20 -20
- data/third_party/boringssl-with-bazel/src/crypto/evp/{p_ed25519.c → p_ed25519.cc} +22 -19
- data/third_party/boringssl-with-bazel/src/crypto/evp/{p_ed25519_asn1.c → p_ed25519_asn1.cc} +14 -13
- data/third_party/boringssl-with-bazel/src/crypto/evp/{p_hkdf.c → p_hkdf.cc} +18 -14
- data/third_party/boringssl-with-bazel/src/crypto/evp/{p_rsa.c → p_rsa.cc} +38 -37
- data/third_party/boringssl-with-bazel/src/crypto/evp/{p_rsa_asn1.c → p_rsa_asn1.cc} +16 -18
- data/third_party/boringssl-with-bazel/src/crypto/evp/{p_x25519.c → p_x25519.cc} +22 -19
- data/third_party/boringssl-with-bazel/src/crypto/evp/{p_x25519_asn1.c → p_x25519_asn1.cc} +18 -17
- data/third_party/boringssl-with-bazel/src/crypto/evp/{pbkdf.c → pbkdf.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/evp/{print.c → print.cc} +4 -5
- data/third_party/boringssl-with-bazel/src/crypto/evp/{scrypt.c → scrypt.cc} +7 -5
- data/third_party/boringssl-with-bazel/src/crypto/{ex_data.c → ex_data.cc} +3 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/{aes_nohw.c.inc → aes_nohw.cc.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/internal.h +1 -5
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/{key_wrap.c.inc → key_wrap.cc.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/{bcm.c → bcm.cc} +96 -101
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm_interface.h +165 -12
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{add.c.inc → add.cc.inc} +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/asm/{x86_64-gcc.c.inc → x86_64-gcc.cc.inc} +4 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{bn.c.inc → bn.cc.inc} +12 -24
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{ctx.c.inc → ctx.cc.inc} +5 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{div.c.inc → div.cc.inc} +29 -38
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{div_extra.c.inc → div_extra.cc.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{exponentiation.c.inc → exponentiation.cc.inc} +22 -22
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{gcd.c.inc → gcd.cc.inc} +3 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{gcd_extra.c.inc → gcd_extra.cc.inc} +33 -25
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{montgomery.c.inc → montgomery.cc.inc} +10 -17
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{mul.c.inc → mul.cc.inc} +11 -15
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{prime.c.inc → prime.cc.inc} +31 -34
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{shift.c.inc → shift.cc.inc} +3 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/{aead.c.inc → aead.cc.inc} +18 -10
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/{cipher.c.inc → cipher.cc.inc} +6 -9
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/{e_aes.c.inc → e_aes.cc.inc} +46 -54
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cmac/{cmac.c.inc → cmac.cc.inc} +6 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/delocate.h +14 -10
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/{dh.c.inc → dh.cc.inc} +15 -19
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/internal.h +1 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/{digest.c.inc → digest.cc.inc} +17 -13
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/{digests.c.inc → digests.cc.inc} +29 -113
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digestsign/{digestsign.c.inc → digestsign.cc.inc} +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/builtin_curves.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{ec.c.inc → ec.cc.inc} +10 -15
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{ec_key.c.inc → ec_key.cc.inc} +12 -14
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{felem.c.inc → felem.cc.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{oct.c.inc → oct.cc.inc} +5 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{p224-64.c.inc → p224-64.cc.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256-nistz-table.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{p256-nistz.c.inc → p256-nistz.cc.inc} +15 -13
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{p256.c.inc → p256.cc.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256_table.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{scalar.c.inc → scalar.cc.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{simple_mul.c.inc → simple_mul.cc.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{util.c.inc → util.cc.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{wnaf.c.inc → wnaf.cc.inc} +24 -15
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdh/{ecdh.c.inc → ecdh.cc.inc} +14 -5
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/{ecdsa.c.inc → ecdsa.cc.inc} +6 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/{fips_shared_support.c → fips_shared_support.cc} +2 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/hkdf/{hkdf.c.inc → hkdf.cc.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/hmac/{hmac.c.inc → hmac.cc.inc} +3 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{gcm.c.inc → gcm.cc.inc} +69 -21
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{gcm_nohw.c.inc → gcm_nohw.cc.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/internal.h +53 -33
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{polyval.c.inc → polyval.cc.inc} +2 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/{ctrdrbg.c.inc → ctrdrbg.cc.inc} +5 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/{rand.c.inc → rand.cc.inc} +20 -18
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/{blinding.c.inc → blinding.cc.inc} +5 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/{padding.c.inc → padding.cc.inc} +21 -21
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/{rsa.c.inc → rsa.cc.inc} +77 -73
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/{rsa_impl.c.inc → rsa_impl.cc.inc} +50 -53
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/{fips.c.inc → fips.cc.inc} +14 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/{self_check.c.inc → self_check.cc.inc} +56 -52
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/service_indicator/{service_indicator.c.inc → service_indicator.cc.inc} +10 -11
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/internal.h +2 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/{sha1.c.inc → sha1.cc.inc} +26 -33
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/{sha256.c.inc → sha256.cc.inc} +37 -55
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/{sha512.c.inc → sha512.cc.inc} +48 -76
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/tls/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/hpke/{hpke.c → hpke.cc} +7 -4
- data/third_party/boringssl-with-bazel/src/crypto/hrss/{hrss.c → hrss.cc} +53 -110
- data/third_party/boringssl-with-bazel/src/crypto/hrss/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +191 -248
- data/third_party/boringssl-with-bazel/src/crypto/keccak/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/keccak/{keccak.c → keccak.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/kyber/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/kyber/{kyber.c → kyber.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/lhash/{lhash.c → lhash.cc} +8 -7
- data/third_party/boringssl-with-bazel/src/crypto/{fipsmodule/md4/md4.c.inc → md4/md4.cc} +8 -12
- data/third_party/boringssl-with-bazel/src/crypto/{fipsmodule/md5 → md5}/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/{fipsmodule/md5/md5.c.inc → md5/md5.cc} +4 -3
- data/third_party/boringssl-with-bazel/src/crypto/{mem.c → mem.cc} +34 -22
- data/third_party/boringssl-with-bazel/src/crypto/mldsa/internal.h +4 -1
- data/third_party/boringssl-with-bazel/src/crypto/mldsa/{mldsa.c → mldsa.cc} +646 -543
- data/third_party/boringssl-with-bazel/src/crypto/mlkem/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/mlkem/mlkem.cc +8 -8
- data/third_party/boringssl-with-bazel/src/crypto/obj/{obj.c → obj.cc} +27 -30
- data/third_party/boringssl-with-bazel/src/crypto/pem/{pem_info.c → pem_info.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/pem/{pem_lib.c → pem_lib.cc} +3 -4
- data/third_party/boringssl-with-bazel/src/crypto/pem/{pem_oth.c → pem_oth.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs7/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs7/{pkcs7.c → pkcs7.cc} +5 -5
- data/third_party/boringssl-with-bazel/src/crypto/pkcs7/{pkcs7_x509.c → pkcs7_x509.cc} +26 -25
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/{p5_pbev2.c → p5_pbev2.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/{pkcs8.c → pkcs8.cc} +159 -158
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/{pkcs8_x509.c → pkcs8_x509.cc} +90 -97
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/{poly1305.c → poly1305.cc} +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/{poly1305_arm.c → poly1305_arm.cc} +4 -2
- data/third_party/boringssl-with-bazel/src/crypto/poly1305/{poly1305_vec.c → poly1305_vec.cc} +14 -11
- data/third_party/boringssl-with-bazel/src/crypto/pool/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/pool/{pool.c → pool.cc} +12 -11
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/{deterministic.c → deterministic.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/{fork_detect.c → fork_detect.cc} +11 -12
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/{forkunsafe.c → forkunsafe.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/{getentropy.c → getentropy.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/getrandom_fillin.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/{ios.c → ios.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/{passive.c → passive.cc} +22 -18
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/{rand_extra.c → rand_extra.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/sysrand_internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/{trusty.c → trusty.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/{urandom.c → urandom.cc} +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/{windows.c → windows.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/{refcount.c → refcount.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/{rsa_asn1.c → rsa_asn1.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/{rsa_crypt.c → rsa_crypt.cc} +81 -78
- data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_extra.cc +17 -0
- data/third_party/boringssl-with-bazel/src/crypto/sha/sha1.cc +52 -0
- data/third_party/boringssl-with-bazel/src/crypto/sha/sha256.cc +87 -0
- data/third_party/boringssl-with-bazel/src/crypto/sha/sha512.cc +104 -0
- data/third_party/boringssl-with-bazel/src/crypto/siphash/{siphash.c → siphash.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/slhdsa/address.h +123 -0
- data/third_party/boringssl-with-bazel/src/crypto/slhdsa/fors.cc +169 -0
- data/third_party/boringssl-with-bazel/src/crypto/slhdsa/fors.h +58 -0
- data/third_party/boringssl-with-bazel/src/crypto/slhdsa/internal.h +63 -0
- data/third_party/boringssl-with-bazel/src/crypto/slhdsa/merkle.cc +161 -0
- data/third_party/boringssl-with-bazel/src/crypto/slhdsa/merkle.h +70 -0
- data/third_party/boringssl-with-bazel/src/crypto/slhdsa/params.h +83 -0
- data/third_party/boringssl-with-bazel/src/crypto/slhdsa/slhdsa.cc +307 -0
- data/third_party/boringssl-with-bazel/src/crypto/slhdsa/thash.cc +173 -0
- data/third_party/boringssl-with-bazel/src/crypto/slhdsa/thash.h +85 -0
- data/third_party/boringssl-with-bazel/src/crypto/slhdsa/wots.cc +171 -0
- data/third_party/boringssl-with-bazel/src/crypto/slhdsa/wots.h +50 -0
- data/third_party/boringssl-with-bazel/src/crypto/stack/{stack.c → stack.cc} +10 -6
- data/third_party/boringssl-with-bazel/src/crypto/{thread_none.c → thread_none.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/{thread_pthread.c → thread_pthread.cc} +9 -8
- data/third_party/boringssl-with-bazel/src/crypto/{thread_win.c → thread_win.cc} +21 -17
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/{pmbtoken.c → pmbtoken.cc} +146 -158
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/{trust_token.c → trust_token.cc} +19 -21
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/{voprf.c → voprf.cc} +165 -169
- data/third_party/boringssl-with-bazel/src/crypto/x509/{a_digest.c → a_digest.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/{a_sign.c → a_sign.cc} +37 -34
- data/third_party/boringssl-with-bazel/src/crypto/x509/{a_verify.c → a_verify.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/{algorithm.c → algorithm.cc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/{asn1_gen.c → asn1_gen.cc} +5 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509/{by_dir.c → by_dir.cc} +7 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509/{policy.c → policy.cc} +188 -178
- data/third_party/boringssl-with-bazel/src/crypto/x509/{rsa_pss.c → rsa_pss.cc} +48 -44
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_akey.c → v3_akey.cc} +4 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_alt.c → v3_alt.cc} +5 -5
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_bcons.c → v3_bcons.cc} +3 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_bitst.c → v3_bitst.cc} +6 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_conf.c → v3_conf.cc} +5 -5
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_cpols.c → v3_cpols.cc} +47 -41
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_crld.c → v3_crld.cc} +3 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_enum.c → v3_enum.cc} +5 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_extku.c → v3_extku.cc} +3 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_genn.c → v3_genn.cc} +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_ia5.c → v3_ia5.cc} +3 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_info.c → v3_info.cc} +4 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_int.c → v3_int.cc} +3 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_lib.c → v3_lib.cc} +9 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_ncons.c → v3_ncons.cc} +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_ocsp.c → v3_ocsp.cc} +4 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_pcons.c → v3_pcons.cc} +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_pmaps.c → v3_pmaps.cc} +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_prn.c → v3_prn.cc} +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_purp.c → v3_purp.cc} +16 -8
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_skey.c → v3_skey.cc} +6 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_utl.c → v3_utl.cc} +15 -10
- data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_att.c → x509_att.cc} +3 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_lu.c → x509_lu.cc} +6 -5
- data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_v3.c → x509_v3.cc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_vfy.c → x509_vfy.cc} +216 -212
- data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_vpm.c → x509_vpm.cc} +55 -13
- data/third_party/boringssl-with-bazel/src/crypto/x509/{x509spki.c → x509spki.cc} +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/{x_all.c → x_all.cc} +10 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509/{x_crl.c → x_crl.cc} +6 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509/{x_name.c → x_name.cc} +39 -32
- data/third_party/boringssl-with-bazel/src/crypto/x509/{x_pubkey.c → x_pubkey.cc} +4 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/{x_x509.c → x_x509.cc} +48 -44
- data/third_party/boringssl-with-bazel/src/crypto/x509/{x_x509a.c → x_x509a.cc} +4 -2
- data/third_party/boringssl-with-bazel/src/gen/crypto/{err_data.c → err_data.cc} +359 -358
- data/third_party/boringssl-with-bazel/src/include/openssl/aead.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/asm_base.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1_mac.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +237 -275
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +12 -5
- data/third_party/boringssl-with-bazel/src/include/openssl/bcm_public.h +82 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/blake2.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/buffer.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/bytestring.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/chacha.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/cmac.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/cpu.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/crypto.h +13 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/ctrdrbg.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/curve25519.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +4 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +6 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +4 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/dtls1.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/e_os2.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/ec_key.h +17 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/engine.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/experimental/kyber.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/hkdf.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/hrss.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/is_boringssl.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/kdf.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/mldsa.h +8 -8
- data/third_party/boringssl-with-bazel/src/include/openssl/mlkem.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/obj_mac.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/objects.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/opensslconf.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/opensslv.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/ossl_typ.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs12.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +2 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/poly1305.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/pool.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/posix_time.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +10 -5
- data/third_party/boringssl-with-bazel/src/include/openssl/safestack.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/sha.h +2 -40
- data/third_party/boringssl-with-bazel/src/include/openssl/siphash.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/slhdsa.h +133 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/span.h +6 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/srtp.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +160 -116
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl3.h +1 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/target.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/thread.h +2 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/time.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/trust_token.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/x509_vfy.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3_errors.h +2 -2
- data/third_party/boringssl-with-bazel/src/ssl/bio_ssl.cc +2 -6
- data/third_party/boringssl-with-bazel/src/ssl/d1_both.cc +667 -322
- data/third_party/boringssl-with-bazel/src/ssl/d1_lib.cc +116 -119
- data/third_party/boringssl-with-bazel/src/ssl/d1_pkt.cc +163 -21
- data/third_party/boringssl-with-bazel/src/ssl/d1_srtp.cc +4 -12
- data/third_party/boringssl-with-bazel/src/ssl/dtls_method.cc +94 -49
- data/third_party/boringssl-with-bazel/src/ssl/dtls_record.cc +296 -198
- data/third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc +23 -14
- data/third_party/boringssl-with-bazel/src/ssl/extensions.cc +363 -343
- data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +48 -58
- data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +44 -36
- data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +145 -159
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +65 -58
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +910 -356
- data/third_party/boringssl-with-bazel/src/ssl/s3_both.cc +29 -41
- data/third_party/boringssl-with-bazel/src/ssl/s3_lib.cc +13 -11
- data/third_party/boringssl-with-bazel/src/ssl/s3_pkt.cc +2 -2
- data/third_party/boringssl-with-bazel/src/ssl/ssl_aead_ctx.cc +90 -183
- data/third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc +38 -64
- data/third_party/boringssl-with-bazel/src/ssl/ssl_buffer.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cert.cc +103 -44
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +210 -220
- data/third_party/boringssl-with-bazel/src/ssl/ssl_credential.cc +70 -12
- data/third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc +20 -17
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +146 -169
- data/third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc +15 -16
- data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +79 -95
- data/third_party/boringssl-with-bazel/src/ssl/ssl_stat.cc +3 -9
- data/third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc +91 -16
- data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +30 -16
- data/third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc +51 -56
- data/third_party/boringssl-with-bazel/src/ssl/t1_enc.cc +22 -25
- data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +43 -27
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +63 -59
- data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +204 -121
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +86 -59
- data/third_party/boringssl-with-bazel/src/ssl/tls_method.cc +51 -62
- data/third_party/boringssl-with-bazel/src/ssl/tls_record.cc +37 -25
- data/third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_32.h +6 -0
- data/third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_64.h +6 -0
- data/third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_64_adx.h +4 -1
- data/third_party/boringssl-with-bazel/src/third_party/fiat/p256_32.h +1 -1
- data/third_party/boringssl-with-bazel/src/third_party/fiat/p256_64.h +3 -0
- metadata +339 -339
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opencensus.upb.h +0 -426
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opencensus.upb_minitable.c +0 -87
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opencensus.upb_minitable.h +0 -32
- data/src/core/ext/upb-gen/opencensus/proto/trace/v1/trace_config.upb.h +0 -408
- data/src/core/ext/upb-gen/opencensus/proto/trace/v1/trace_config.upb_minitable.c +0 -124
- data/src/core/ext/upb-gen/opencensus/proto/trace/v1/trace_config.upb_minitable.h +0 -38
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opencensus.upbdefs.c +0 -108
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opencensus.upbdefs.h +0 -33
- data/src/core/ext/upbdefs-gen/opencensus/proto/trace/v1/trace_config.upbdefs.c +0 -67
- data/src/core/ext/upbdefs-gen/opencensus/proto/trace/v1/trace_config.upbdefs.h +0 -48
- data/src/core/util/atm.cc +0 -34
- data/third_party/boringssl-with-bazel/src/crypto/dilithium/dilithium.c +0 -1539
- data/third_party/boringssl-with-bazel/src/crypto/dilithium/internal.h +0 -58
- data/third_party/boringssl-with-bazel/src/crypto/spx/address.c +0 -101
- data/third_party/boringssl-with-bazel/src/crypto/spx/address.h +0 -50
- data/third_party/boringssl-with-bazel/src/crypto/spx/fors.c +0 -133
- data/third_party/boringssl-with-bazel/src/crypto/spx/fors.h +0 -54
- data/third_party/boringssl-with-bazel/src/crypto/spx/merkle.c +0 -150
- data/third_party/boringssl-with-bazel/src/crypto/spx/merkle.h +0 -61
- data/third_party/boringssl-with-bazel/src/crypto/spx/params.h +0 -71
- data/third_party/boringssl-with-bazel/src/crypto/spx/spx.c +0 -140
- data/third_party/boringssl-with-bazel/src/crypto/spx/spx_util.c +0 -53
- data/third_party/boringssl-with-bazel/src/crypto/spx/spx_util.h +0 -44
- data/third_party/boringssl-with-bazel/src/crypto/spx/thash.c +0 -136
- data/third_party/boringssl-with-bazel/src/crypto/spx/thash.h +0 -70
- data/third_party/boringssl-with-bazel/src/crypto/spx/wots.c +0 -135
- data/third_party/boringssl-with-bazel/src/crypto/spx/wots.h +0 -45
- data/third_party/boringssl-with-bazel/src/include/openssl/experimental/dilithium.h +0 -129
- data/third_party/boringssl-with-bazel/src/include/openssl/experimental/spx.h +0 -90
- /data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_bool.c → a_bool.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_gentm.c → a_gentm.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_octet.c → a_octet.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_strex.c → a_strex.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_time.c → a_time.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/asn1/{a_utctm.c → a_utctm.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/asn1/{asn1_par.c → asn1_par.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/asn1/{f_int.c → f_int.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/asn1/{f_string.c → f_string.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/asn1/{tasn_typ.c → tasn_typ.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/bio/{errno.c → errno.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/bio/{fd.c → fd.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/bio/{hexdump.c → hexdump.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/bio/{socket.c → socket.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/{cipher_extra.c → cipher_extra.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/{derive_key.c → derive_key.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/{tls_cbc.c → tls_cbc.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/des/{des.c → des.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/dh_extra/{params.c → params.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/ecdh_extra/{ecdh_extra.c → ecdh_extra.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/evp/{evp_asn1.c → evp_asn1.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/evp/{sign.c → sign.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/{aes.c.inc → aes.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/{mode_wrappers.c.inc → mode_wrappers.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{bytes.c.inc → bytes.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{cmp.c.inc → cmp.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{generic.c.inc → generic.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{jacobi.c.inc → jacobi.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{montgomery_inv.c.inc → montgomery_inv.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{random.c.inc → random.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{rsaz_exp.c.inc → rsaz_exp.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{sqrt.c.inc → sqrt.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/{e_aesccm.c.inc → e_aesccm.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/{check.c.inc → check.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{ec_montgomery.c.inc → ec_montgomery.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{simple.c.inc → simple.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{cbc.c.inc → cbc.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{cfb.c.inc → cfb.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{ctr.c.inc → ctr.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{ofb.c.inc → ofb.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/tls/{kdf.c.inc → kdf.cc.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/obj/{obj_xref.c → obj_xref.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/pem/{pem_all.c → pem_all.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/pem/{pem_pk8.c → pem_pk8.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/pem/{pem_pkey.c → pem_pkey.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/pem/{pem_x509.c → pem_x509.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/pem/{pem_xaux.c → pem_xaux.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/rc4/{rc4.c → rc4.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/{rsa_print.c → rsa_print.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/{thread.c → thread.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{by_file.c → by_file.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{i2d_pr.c → i2d_pr.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{name_print.c → name_print.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{t_crl.c → t_crl.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{t_req.c → t_req.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{t_x509.c → t_x509.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{t_x509a.c → t_x509a.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{v3_akeya.c → v3_akeya.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x509.c → x509.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_cmp.c → x509_cmp.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_d2.c → x509_d2.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_def.c → x509_def.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_ext.c → x509_ext.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_obj.c → x509_obj.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_req.c → x509_req.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_set.c → x509_set.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_trs.c → x509_trs.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x509_txt.c → x509_txt.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x509cset.c → x509cset.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x509name.c → x509name.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x509rset.c → x509rset.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x_algor.c → x_algor.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x_attrib.c → x_attrib.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x_exten.c → x_exten.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x_req.c → x_req.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x_sig.c → x_sig.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x_spki.c → x_spki.cc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/x509/{x_val.c → x_val.cc} +0 -0
@@ -63,8 +63,8 @@
|
|
63
63
|
#include <openssl/err.h>
|
64
64
|
#include <openssl/mem.h>
|
65
65
|
|
66
|
-
#include "internal.h"
|
67
66
|
#include "../delocate.h"
|
67
|
+
#include "internal.h"
|
68
68
|
|
69
69
|
|
70
70
|
// BN_MAX_WORDS is the maximum number of words allowed in a |BIGNUM|. It is
|
@@ -73,7 +73,7 @@
|
|
73
73
|
#define BN_MAX_WORDS (INT_MAX / (4 * BN_BITS2))
|
74
74
|
|
75
75
|
BIGNUM *BN_new(void) {
|
76
|
-
BIGNUM *bn = OPENSSL_malloc(sizeof(BIGNUM));
|
76
|
+
BIGNUM *bn = reinterpret_cast<BIGNUM *>(OPENSSL_malloc(sizeof(BIGNUM)));
|
77
77
|
|
78
78
|
if (bn == NULL) {
|
79
79
|
return NULL;
|
@@ -87,9 +87,7 @@ BIGNUM *BN_new(void) {
|
|
87
87
|
|
88
88
|
BIGNUM *BN_secure_new(void) { return BN_new(); }
|
89
89
|
|
90
|
-
void BN_init(BIGNUM *bn) {
|
91
|
-
OPENSSL_memset(bn, 0, sizeof(BIGNUM));
|
92
|
-
}
|
90
|
+
void BN_init(BIGNUM *bn) { OPENSSL_memset(bn, 0, sizeof(BIGNUM)); }
|
93
91
|
|
94
92
|
void BN_free(BIGNUM *bn) {
|
95
93
|
if (bn == NULL) {
|
@@ -107,9 +105,7 @@ void BN_free(BIGNUM *bn) {
|
|
107
105
|
}
|
108
106
|
}
|
109
107
|
|
110
|
-
void BN_clear_free(BIGNUM *bn) {
|
111
|
-
BN_free(bn);
|
112
|
-
}
|
108
|
+
void BN_clear_free(BIGNUM *bn) { BN_free(bn); }
|
113
109
|
|
114
110
|
BIGNUM *BN_dup(const BIGNUM *src) {
|
115
111
|
BIGNUM *copy;
|
@@ -157,8 +153,8 @@ void BN_clear(BIGNUM *bn) {
|
|
157
153
|
}
|
158
154
|
|
159
155
|
DEFINE_METHOD_FUNCTION(BIGNUM, BN_value_one) {
|
160
|
-
static const BN_ULONG kOneLimbs[1] = {
|
161
|
-
out->d = (BN_ULONG*)
|
156
|
+
static const BN_ULONG kOneLimbs[1] = {1};
|
157
|
+
out->d = (BN_ULONG *)kOneLimbs;
|
162
158
|
out->width = 1;
|
163
159
|
out->dmax = 1;
|
164
160
|
out->neg = 0;
|
@@ -229,17 +225,11 @@ unsigned BN_num_bits(const BIGNUM *bn) {
|
|
229
225
|
return (width - 1) * BN_BITS2 + BN_num_bits_word(bn->d[width - 1]);
|
230
226
|
}
|
231
227
|
|
232
|
-
unsigned BN_num_bytes(const BIGNUM *bn) {
|
233
|
-
return (BN_num_bits(bn) + 7) / 8;
|
234
|
-
}
|
228
|
+
unsigned BN_num_bytes(const BIGNUM *bn) { return (BN_num_bits(bn) + 7) / 8; }
|
235
229
|
|
236
|
-
void BN_zero(BIGNUM *bn) {
|
237
|
-
bn->width = bn->neg = 0;
|
238
|
-
}
|
230
|
+
void BN_zero(BIGNUM *bn) { bn->width = bn->neg = 0; }
|
239
231
|
|
240
|
-
int BN_one(BIGNUM *bn) {
|
241
|
-
return BN_set_word(bn, 1);
|
242
|
-
}
|
232
|
+
int BN_one(BIGNUM *bn) { return BN_set_word(bn, 1); }
|
243
233
|
|
244
234
|
int BN_set_word(BIGNUM *bn, BN_ULONG value) {
|
245
235
|
if (value == 0) {
|
@@ -332,9 +322,7 @@ int bn_copy_words(BN_ULONG *out, size_t num, const BIGNUM *bn) {
|
|
332
322
|
return 1;
|
333
323
|
}
|
334
324
|
|
335
|
-
int BN_is_negative(const BIGNUM *bn) {
|
336
|
-
return bn->neg != 0;
|
337
|
-
}
|
325
|
+
int BN_is_negative(const BIGNUM *bn) { return bn->neg != 0; }
|
338
326
|
|
339
327
|
void BN_set_negative(BIGNUM *bn, int sign) {
|
340
328
|
if (sign && !BN_is_zero(bn)) {
|
@@ -361,7 +349,7 @@ int bn_wexpand(BIGNUM *bn, size_t words) {
|
|
361
349
|
return 0;
|
362
350
|
}
|
363
351
|
|
364
|
-
a = OPENSSL_calloc(words, sizeof(BN_ULONG));
|
352
|
+
a = reinterpret_cast<BN_ULONG *>(OPENSSL_calloc(words, sizeof(BN_ULONG)));
|
365
353
|
if (a == NULL) {
|
366
354
|
return 0;
|
367
355
|
}
|
@@ -380,7 +368,7 @@ int bn_expand(BIGNUM *bn, size_t bits) {
|
|
380
368
|
OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG);
|
381
369
|
return 0;
|
382
370
|
}
|
383
|
-
return bn_wexpand(bn, (bits+BN_BITS2-1)/BN_BITS2);
|
371
|
+
return bn_wexpand(bn, (bits + BN_BITS2 - 1) / BN_BITS2);
|
384
372
|
}
|
385
373
|
|
386
374
|
int bn_resize_words(BIGNUM *bn, size_t words) {
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* are met:
|
8
8
|
*
|
9
9
|
* 1. Redistributions of source code must retain the above copyright
|
10
|
-
* notice, this list of conditions and the following disclaimer.
|
10
|
+
* notice, this list of conditions and the following disclaimer.
|
11
11
|
*
|
12
12
|
* 2. Redistributions in binary form must reproduce the above copyright
|
13
13
|
* notice, this list of conditions and the following disclaimer in
|
@@ -106,7 +106,7 @@ struct bignum_ctx {
|
|
106
106
|
};
|
107
107
|
|
108
108
|
BN_CTX *BN_CTX_new(void) {
|
109
|
-
BN_CTX *ret = OPENSSL_malloc(sizeof(BN_CTX));
|
109
|
+
BN_CTX *ret = reinterpret_cast<BN_CTX *>(OPENSSL_malloc(sizeof(BN_CTX)));
|
110
110
|
if (!ret) {
|
111
111
|
return NULL;
|
112
112
|
}
|
@@ -201,9 +201,7 @@ static void BN_STACK_init(BN_STACK *st) {
|
|
201
201
|
st->depth = st->size = 0;
|
202
202
|
}
|
203
203
|
|
204
|
-
static void BN_STACK_cleanup(BN_STACK *st) {
|
205
|
-
OPENSSL_free(st->indexes);
|
206
|
-
}
|
204
|
+
static void BN_STACK_cleanup(BN_STACK *st) { OPENSSL_free(st->indexes); }
|
207
205
|
|
208
206
|
static int BN_STACK_push(BN_STACK *st, size_t idx) {
|
209
207
|
if (st->depth == st->size) {
|
@@ -213,8 +211,8 @@ static int BN_STACK_push(BN_STACK *st, size_t idx) {
|
|
213
211
|
if (new_size <= st->size || new_size > SIZE_MAX / sizeof(size_t)) {
|
214
212
|
return 0;
|
215
213
|
}
|
216
|
-
size_t *new_indexes =
|
217
|
-
OPENSSL_realloc(st->indexes, new_size * sizeof(size_t));
|
214
|
+
size_t *new_indexes = reinterpret_cast<size_t *>(
|
215
|
+
OPENSSL_realloc(st->indexes, new_size * sizeof(size_t)));
|
218
216
|
if (new_indexes == NULL) {
|
219
217
|
return 0;
|
220
218
|
}
|
@@ -66,8 +66,7 @@
|
|
66
66
|
|
67
67
|
// bn_div_words divides a double-width |h|,|l| by |d| and returns the result,
|
68
68
|
// which must fit in a |BN_ULONG|.
|
69
|
-
|
70
|
-
BN_ULONG d) {
|
69
|
+
static inline BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) {
|
71
70
|
BN_ULONG dh, dl, q, ret = 0, th, tl, t;
|
72
71
|
int i, count = 2;
|
73
72
|
|
@@ -195,6 +194,8 @@ int BN_div(BIGNUM *quotient, BIGNUM *rem, const BIGNUM *numerator,
|
|
195
194
|
BIGNUM *snum = BN_CTX_get(ctx);
|
196
195
|
BIGNUM *sdiv = BN_CTX_get(ctx);
|
197
196
|
BIGNUM *res = quotient == NULL ? BN_CTX_get(ctx) : quotient;
|
197
|
+
int norm_shift, num_n, loop, div_n;
|
198
|
+
BN_ULONG d0, d1;
|
198
199
|
if (tmp == NULL || snum == NULL || sdiv == NULL || res == NULL) {
|
199
200
|
goto err;
|
200
201
|
}
|
@@ -202,7 +203,7 @@ int BN_div(BIGNUM *quotient, BIGNUM *rem, const BIGNUM *numerator,
|
|
202
203
|
// Knuth step D1: Normalise the numbers such that the divisor's MSB is set.
|
203
204
|
// This ensures, in Knuth's terminology, that v1 >= b/2, needed for the
|
204
205
|
// quotient estimation step.
|
205
|
-
|
206
|
+
norm_shift = BN_BITS2 - (BN_num_bits(divisor) % BN_BITS2);
|
206
207
|
if (!BN_lshift(sdiv, divisor, norm_shift) ||
|
207
208
|
!BN_lshift(snum, numerator, norm_shift)) {
|
208
209
|
goto err;
|
@@ -213,9 +214,9 @@ int BN_div(BIGNUM *quotient, BIGNUM *rem, const BIGNUM *numerator,
|
|
213
214
|
// avoid looping on leading zeros, as we're not trying to be leak-free.
|
214
215
|
bn_set_minimal_width(sdiv);
|
215
216
|
bn_set_minimal_width(snum);
|
216
|
-
|
217
|
-
|
218
|
-
|
217
|
+
div_n = sdiv->width;
|
218
|
+
d0 = sdiv->d[div_n - 1];
|
219
|
+
d1 = (div_n == 1) ? 0 : sdiv->d[div_n - 2];
|
219
220
|
assert(d0 & (((BN_ULONG)1) << (BN_BITS2 - 1)));
|
220
221
|
|
221
222
|
// Extend |snum| with zeros to satisfy the long division invariants:
|
@@ -223,14 +224,14 @@ int BN_div(BIGNUM *quotient, BIGNUM *rem, const BIGNUM *numerator,
|
|
223
224
|
// - |snum|'s most significant word must be zero to guarantee the first loop
|
224
225
|
// iteration works with a prefix greater than |sdiv|. (This is the extra u0
|
225
226
|
// digit in Knuth step D1.)
|
226
|
-
|
227
|
+
num_n = snum->width <= div_n ? div_n + 1 : snum->width + 1;
|
227
228
|
if (!bn_resize_words(snum, num_n)) {
|
228
229
|
goto err;
|
229
230
|
}
|
230
231
|
|
231
232
|
// Knuth step D2: The quotient's width is the difference between numerator and
|
232
233
|
// denominator. Also set up its sign and size a temporary for the loop.
|
233
|
-
|
234
|
+
loop = num_n - div_n;
|
234
235
|
res->neg = snum->neg ^ sdiv->neg;
|
235
236
|
if (!bn_wexpand(res, loop) || //
|
236
237
|
!bn_wexpand(tmp, div_n + 1)) {
|
@@ -447,9 +448,9 @@ int bn_div_consttime(BIGNUM *quotient, BIGNUM *remainder,
|
|
447
448
|
r = BN_CTX_get(ctx);
|
448
449
|
}
|
449
450
|
BIGNUM *tmp = BN_CTX_get(ctx);
|
451
|
+
int initial_words;
|
450
452
|
if (q == NULL || r == NULL || tmp == NULL ||
|
451
|
-
!bn_wexpand(q, numerator->width) ||
|
452
|
-
!bn_wexpand(r, divisor->width) ||
|
453
|
+
!bn_wexpand(q, numerator->width) || !bn_wexpand(r, divisor->width) ||
|
453
454
|
!bn_wexpand(tmp, divisor->width)) {
|
454
455
|
goto err;
|
455
456
|
}
|
@@ -472,7 +473,7 @@ int bn_div_consttime(BIGNUM *quotient, BIGNUM *remainder,
|
|
472
473
|
// without reductions. This significantly speeds up |RSA_check_key|. For
|
473
474
|
// simplicity, we round down to a whole number of words.
|
474
475
|
declassify_assert(divisor_min_bits <= BN_num_bits(divisor));
|
475
|
-
|
476
|
+
initial_words = 0;
|
476
477
|
if (divisor_min_bits > 0) {
|
477
478
|
initial_words = (divisor_min_bits - 1) / BN_BITS2;
|
478
479
|
if (initial_words > numerator->width) {
|
@@ -514,8 +515,7 @@ err:
|
|
514
515
|
|
515
516
|
static BIGNUM *bn_scratch_space_from_ctx(size_t width, BN_CTX *ctx) {
|
516
517
|
BIGNUM *ret = BN_CTX_get(ctx);
|
517
|
-
if (ret == NULL ||
|
518
|
-
!bn_wexpand(ret, width)) {
|
518
|
+
if (ret == NULL || !bn_wexpand(ret, width)) {
|
519
519
|
return NULL;
|
520
520
|
}
|
521
521
|
ret->neg = 0;
|
@@ -536,9 +536,7 @@ static const BIGNUM *bn_resized_from_ctx(const BIGNUM *bn, size_t width,
|
|
536
536
|
return bn;
|
537
537
|
}
|
538
538
|
BIGNUM *ret = bn_scratch_space_from_ctx(width, ctx);
|
539
|
-
if (ret == NULL ||
|
540
|
-
!BN_copy(ret, bn) ||
|
541
|
-
!bn_resize_words(ret, width)) {
|
539
|
+
if (ret == NULL || !BN_copy(ret, bn) || !bn_resize_words(ret, width)) {
|
542
540
|
return NULL;
|
543
541
|
}
|
544
542
|
return ret;
|
@@ -555,8 +553,7 @@ int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
|
|
555
553
|
int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
556
554
|
const BIGNUM *m) {
|
557
555
|
BN_CTX *ctx = BN_CTX_new();
|
558
|
-
int ok = ctx != NULL &&
|
559
|
-
bn_mod_add_consttime(r, a, b, m, ctx);
|
556
|
+
int ok = ctx != NULL && bn_mod_add_consttime(r, a, b, m, ctx);
|
560
557
|
BN_CTX_free(ctx);
|
561
558
|
return ok;
|
562
559
|
}
|
@@ -567,8 +564,7 @@ int bn_mod_add_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
|
567
564
|
a = bn_resized_from_ctx(a, m->width, ctx);
|
568
565
|
b = bn_resized_from_ctx(b, m->width, ctx);
|
569
566
|
BIGNUM *tmp = bn_scratch_space_from_ctx(m->width, ctx);
|
570
|
-
int ok = a != NULL && b != NULL && tmp != NULL &&
|
571
|
-
bn_wexpand(r, m->width);
|
567
|
+
int ok = a != NULL && b != NULL && tmp != NULL && bn_wexpand(r, m->width);
|
572
568
|
if (ok) {
|
573
569
|
bn_mod_add_words(r->d, a->d, b->d, m->d, tmp->d, m->width);
|
574
570
|
r->width = m->width;
|
@@ -592,8 +588,7 @@ int bn_mod_sub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
|
592
588
|
a = bn_resized_from_ctx(a, m->width, ctx);
|
593
589
|
b = bn_resized_from_ctx(b, m->width, ctx);
|
594
590
|
BIGNUM *tmp = bn_scratch_space_from_ctx(m->width, ctx);
|
595
|
-
int ok = a != NULL && b != NULL && tmp != NULL &&
|
596
|
-
bn_wexpand(r, m->width);
|
591
|
+
int ok = a != NULL && b != NULL && tmp != NULL && bn_wexpand(r, m->width);
|
597
592
|
if (ok) {
|
598
593
|
bn_mod_sub_words(r->d, a->d, b->d, m->d, tmp->d, m->width);
|
599
594
|
r->width = m->width;
|
@@ -606,8 +601,7 @@ int bn_mod_sub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
|
606
601
|
int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
607
602
|
const BIGNUM *m) {
|
608
603
|
BN_CTX *ctx = BN_CTX_new();
|
609
|
-
int ok = ctx != NULL &&
|
610
|
-
bn_mod_sub_consttime(r, a, b, m, ctx);
|
604
|
+
int ok = ctx != NULL && bn_mod_sub_consttime(r, a, b, m, ctx);
|
611
605
|
BN_CTX_free(ctx);
|
612
606
|
return ok;
|
613
607
|
}
|
@@ -678,8 +672,7 @@ int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m,
|
|
678
672
|
|
679
673
|
int bn_mod_lshift_consttime(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m,
|
680
674
|
BN_CTX *ctx) {
|
681
|
-
if (!BN_copy(r, a) ||
|
682
|
-
!bn_resize_words(r, m->width)) {
|
675
|
+
if (!BN_copy(r, a) || !bn_resize_words(r, m->width)) {
|
683
676
|
return 0;
|
684
677
|
}
|
685
678
|
|
@@ -698,8 +691,7 @@ int bn_mod_lshift_consttime(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m,
|
|
698
691
|
|
699
692
|
int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m) {
|
700
693
|
BN_CTX *ctx = BN_CTX_new();
|
701
|
-
int ok = ctx != NULL &&
|
702
|
-
bn_mod_lshift_consttime(r, a, n, m, ctx);
|
694
|
+
int ok = ctx != NULL && bn_mod_lshift_consttime(r, a, n, m, ctx);
|
703
695
|
BN_CTX_free(ctx);
|
704
696
|
return ok;
|
705
697
|
}
|
@@ -719,8 +711,7 @@ int bn_mod_lshift1_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *m,
|
|
719
711
|
|
720
712
|
int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m) {
|
721
713
|
BN_CTX *ctx = BN_CTX_new();
|
722
|
-
int ok = ctx != NULL &&
|
723
|
-
bn_mod_lshift1_consttime(r, a, m, ctx);
|
714
|
+
int ok = ctx != NULL && bn_mod_lshift1_consttime(r, a, m, ctx);
|
724
715
|
BN_CTX_free(ctx);
|
725
716
|
return ok;
|
726
717
|
}
|
@@ -731,7 +722,7 @@ BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w) {
|
|
731
722
|
|
732
723
|
if (!w) {
|
733
724
|
// actually this an error (division by zero)
|
734
|
-
return (BN_ULONG)
|
725
|
+
return (BN_ULONG)-1;
|
735
726
|
}
|
736
727
|
|
737
728
|
if (a->width == 0) {
|
@@ -742,7 +733,7 @@ BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w) {
|
|
742
733
|
j = BN_BITS2 - BN_num_bits_word(w);
|
743
734
|
w <<= j;
|
744
735
|
if (!BN_lshift(a, a, j)) {
|
745
|
-
return (BN_ULONG)
|
736
|
+
return (BN_ULONG)-1;
|
746
737
|
}
|
747
738
|
|
748
739
|
for (i = a->width - 1; i >= 0; i--) {
|
@@ -768,7 +759,7 @@ BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w) {
|
|
768
759
|
int i;
|
769
760
|
|
770
761
|
if (w == 0) {
|
771
|
-
return (BN_ULONG)
|
762
|
+
return (BN_ULONG)-1;
|
772
763
|
}
|
773
764
|
|
774
765
|
#ifndef BN_CAN_DIVIDE_ULLONG
|
@@ -805,7 +796,7 @@ int BN_mod_pow2(BIGNUM *r, const BIGNUM *a, size_t e) {
|
|
805
796
|
size_t num_words = 1 + ((e - 1) / BN_BITS2);
|
806
797
|
|
807
798
|
// If |a| definitely has less than |e| bits, just BN_copy.
|
808
|
-
if ((size_t)
|
799
|
+
if ((size_t)a->width < num_words) {
|
809
800
|
return BN_copy(r, a) != NULL;
|
810
801
|
}
|
811
802
|
|
@@ -821,12 +812,12 @@ int BN_mod_pow2(BIGNUM *r, const BIGNUM *a, size_t e) {
|
|
821
812
|
// If |e| isn't word-aligned, we have to mask off some of our bits.
|
822
813
|
size_t top_word_exponent = e % (sizeof(BN_ULONG) * 8);
|
823
814
|
if (top_word_exponent != 0) {
|
824
|
-
r->d[num_words - 1] &= (((BN_ULONG)
|
815
|
+
r->d[num_words - 1] &= (((BN_ULONG)1) << top_word_exponent) - 1;
|
825
816
|
}
|
826
817
|
|
827
818
|
// Fill in the remaining fields of |r|.
|
828
819
|
r->neg = a->neg;
|
829
|
-
r->width = (int)
|
820
|
+
r->width = (int)num_words;
|
830
821
|
bn_set_minimal_width(r);
|
831
822
|
return 1;
|
832
823
|
}
|
@@ -853,7 +844,7 @@ int BN_nnmod_pow2(BIGNUM *r, const BIGNUM *a, size_t e) {
|
|
853
844
|
|
854
845
|
// Set parameters of |r|.
|
855
846
|
r->neg = 0;
|
856
|
-
r->width = (int)
|
847
|
+
r->width = (int)num_words;
|
857
848
|
|
858
849
|
// Now, invert every word. The idea here is that we want to compute 2^e-|x|,
|
859
850
|
// which is actually equivalent to the twos-complement representation of |x|
|
@@ -865,7 +856,7 @@ int BN_nnmod_pow2(BIGNUM *r, const BIGNUM *a, size_t e) {
|
|
865
856
|
// If our exponent doesn't span the top word, we have to mask the rest.
|
866
857
|
size_t top_word_exponent = e % BN_BITS2;
|
867
858
|
if (top_word_exponent != 0) {
|
868
|
-
r->d[r->width - 1] &= (((BN_ULONG)
|
859
|
+
r->d[r->width - 1] &= (((BN_ULONG)1) << top_word_exponent) - 1;
|
869
860
|
}
|
870
861
|
|
871
862
|
// Keep the minimal-width invariant for |BIGNUM|.
|
@@ -130,9 +130,9 @@
|
|
130
130
|
// WARNING: This function implements Almost Montgomery Multiplication from
|
131
131
|
// https://eprint.iacr.org/2011/239. The inputs do not need to be fully reduced.
|
132
132
|
// However, even if they are fully reduced, the output may not be.
|
133
|
-
static void bn_mul_mont_gather5(
|
134
|
-
|
135
|
-
|
133
|
+
static void bn_mul_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap,
|
134
|
+
const BN_ULONG *table, const BN_ULONG *np,
|
135
|
+
const BN_ULONG *n0, int num, int power) {
|
136
136
|
if (bn_mulx4x_mont_gather5_capable(num)) {
|
137
137
|
bn_mulx4x_mont_gather5(rp, ap, table, np, n0, num, power);
|
138
138
|
} else if (bn_mul4x_mont_gather5_capable(num)) {
|
@@ -162,7 +162,7 @@ static void bn_power5(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *table,
|
|
162
162
|
}
|
163
163
|
}
|
164
164
|
|
165
|
-
#endif
|
165
|
+
#endif // defined(OPENSSL_BN_ASM_MONT5)
|
166
166
|
|
167
167
|
int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) {
|
168
168
|
int i, bits, ret = 0;
|
@@ -534,9 +534,9 @@ static int mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
|
534
534
|
}
|
535
535
|
}
|
536
536
|
|
537
|
-
start = 1;
|
538
|
-
|
539
|
-
|
537
|
+
start = 1; // This is used to avoid multiplication etc
|
538
|
+
// when there is only the value '1' in the
|
539
|
+
// buffer.
|
540
540
|
wstart = bits - 1; // The top bit of the window
|
541
541
|
|
542
542
|
if (!BN_one(r)) {
|
@@ -545,7 +545,7 @@ static int mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
|
545
545
|
|
546
546
|
for (;;) {
|
547
547
|
int wvalue; // The 'value' of the window
|
548
|
-
int wend;
|
548
|
+
int wend; // The bottom bit of the window
|
549
549
|
|
550
550
|
if (!BN_is_bit_set(p, wstart)) {
|
551
551
|
if (!start) {
|
@@ -661,6 +661,7 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
|
661
661
|
BN_CTX_start(ctx);
|
662
662
|
BIGNUM *r = BN_CTX_get(ctx);
|
663
663
|
val[0] = BN_CTX_get(ctx);
|
664
|
+
int window, r_is_one, wstart;
|
664
665
|
if (r == NULL || val[0] == NULL) {
|
665
666
|
goto err;
|
666
667
|
}
|
@@ -678,14 +679,13 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
|
678
679
|
// precomputing powers of |a|. Windows may be shifted so they always end on a
|
679
680
|
// set bit, so only precompute odd powers. We compute val[i] = a^(2*i + 1)
|
680
681
|
// for i = 0 to 2^(window-1), all in Montgomery form.
|
681
|
-
|
682
|
+
window = BN_window_bits_for_exponent_size(bits);
|
682
683
|
if (!BN_to_montgomery(val[0], a, mont, ctx)) {
|
683
684
|
goto err;
|
684
685
|
}
|
685
686
|
if (window > 1) {
|
686
687
|
BIGNUM *d = BN_CTX_get(ctx);
|
687
|
-
if (d == NULL ||
|
688
|
-
!BN_mod_mul_montgomery(d, val[0], val[0], mont, ctx)) {
|
688
|
+
if (d == NULL || !BN_mod_mul_montgomery(d, val[0], val[0], mont, ctx)) {
|
689
689
|
goto err;
|
690
690
|
}
|
691
691
|
for (int i = 1; i < 1 << (window - 1); i++) {
|
@@ -699,8 +699,8 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
|
699
699
|
|
700
700
|
// |p| is non-zero, so at least one window is non-zero. To save some
|
701
701
|
// multiplications, defer initializing |r| until then.
|
702
|
-
|
703
|
-
|
702
|
+
r_is_one = 1;
|
703
|
+
wstart = bits - 1; // The top bit of the window.
|
704
704
|
for (;;) {
|
705
705
|
if (!BN_is_bit_set(p, wstart)) {
|
706
706
|
if (!r_is_one && !BN_mod_mul_montgomery(r, r, r, mont, ctx)) {
|
@@ -930,7 +930,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
|
930
930
|
int i, ret = 0, wvalue;
|
931
931
|
BN_MONT_CTX *new_mont = NULL;
|
932
932
|
|
933
|
-
|
933
|
+
void *powerbuf_free = NULL;
|
934
934
|
size_t powerbuf_len = 0;
|
935
935
|
BN_ULONG *powerbuf = NULL;
|
936
936
|
|
@@ -963,6 +963,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
|
963
963
|
}
|
964
964
|
|
965
965
|
// Allocate a montgomery context if it was not supplied by the caller.
|
966
|
+
int top, num_powers, window;
|
966
967
|
if (mont == NULL) {
|
967
968
|
new_mont = BN_MONT_CTX_new_consttime(m, ctx);
|
968
969
|
if (new_mont == NULL) {
|
@@ -973,7 +974,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
|
973
974
|
|
974
975
|
// Use the width in |mont->N|, rather than the copy in |m|. The assembly
|
975
976
|
// implementation assumes it can use |top| to size R.
|
976
|
-
|
977
|
+
top = mont->N.width;
|
977
978
|
|
978
979
|
#if defined(OPENSSL_BN_ASM_MONT5) || defined(RSAZ_ENABLED)
|
979
980
|
// Share one large stack-allocated buffer between the RSAZ and non-RSAZ code
|
@@ -1001,7 +1002,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
|
1001
1002
|
#endif
|
1002
1003
|
|
1003
1004
|
// Get the window size to use with size of p.
|
1004
|
-
|
1005
|
+
window = BN_window_bits_for_ctime_exponent_size(bits);
|
1005
1006
|
assert(window <= BN_MAX_MOD_EXP_CTIME_WINDOW);
|
1006
1007
|
|
1007
1008
|
// Calculating |powerbuf_len| below cannot overflow because of the bound on
|
@@ -1022,7 +1023,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
|
1022
1023
|
|
1023
1024
|
// Allocate a buffer large enough to hold all of the pre-computed
|
1024
1025
|
// powers of |am|, |am| itself, and |tmp|.
|
1025
|
-
|
1026
|
+
num_powers = 1 << window;
|
1026
1027
|
powerbuf_len += sizeof(m->d[0]) * top * (num_powers + 2);
|
1027
1028
|
|
1028
1029
|
#if defined(OPENSSL_BN_ASM_MONT5)
|
@@ -1037,7 +1038,8 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
|
1037
1038
|
if (powerbuf_free == NULL) {
|
1038
1039
|
goto err;
|
1039
1040
|
}
|
1040
|
-
powerbuf =
|
1041
|
+
powerbuf = reinterpret_cast<BN_ULONG *>(
|
1042
|
+
align_pointer(powerbuf_free, MOD_EXP_CTIME_ALIGN));
|
1041
1043
|
}
|
1042
1044
|
OPENSSL_memset(powerbuf, 0, powerbuf_len);
|
1043
1045
|
|
@@ -1050,16 +1052,14 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
|
|
1050
1052
|
tmp.neg = am.neg = 0;
|
1051
1053
|
tmp.flags = am.flags = BN_FLG_STATIC_DATA;
|
1052
1054
|
|
1053
|
-
if (!bn_one_to_montgomery(&tmp, mont, ctx) ||
|
1054
|
-
!bn_resize_words(&tmp, top)) {
|
1055
|
+
if (!bn_one_to_montgomery(&tmp, mont, ctx) || !bn_resize_words(&tmp, top)) {
|
1055
1056
|
goto err;
|
1056
1057
|
}
|
1057
1058
|
|
1058
1059
|
// Prepare a^1 in the Montgomery domain.
|
1059
1060
|
assert(!a->neg);
|
1060
1061
|
declassify_assert(BN_ucmp(a, m) < 0);
|
1061
|
-
if (!BN_to_montgomery(&am, a, mont, ctx) ||
|
1062
|
-
!bn_resize_words(&am, top)) {
|
1062
|
+
if (!BN_to_montgomery(&am, a, mont, ctx) || !bn_resize_words(&am, top)) {
|
1063
1063
|
goto err;
|
1064
1064
|
}
|
1065
1065
|
|
@@ -136,12 +136,11 @@ int BN_mod_inverse_odd(BIGNUM *out, int *out_no_inverse, const BIGNUM *a,
|
|
136
136
|
B = BN_CTX_get(ctx);
|
137
137
|
X = BN_CTX_get(ctx);
|
138
138
|
Y = BN_CTX_get(ctx);
|
139
|
+
BIGNUM *R = out;
|
139
140
|
if (Y == NULL) {
|
140
141
|
goto err;
|
141
142
|
}
|
142
143
|
|
143
|
-
BIGNUM *R = out;
|
144
|
-
|
145
144
|
BN_zero(Y);
|
146
145
|
if (!BN_one(X) || BN_copy(B, a) == NULL || BN_copy(A, n) == NULL) {
|
147
146
|
goto err;
|
@@ -376,8 +375,7 @@ int bn_mod_inverse_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p,
|
|
376
375
|
BN_CTX *ctx, const BN_MONT_CTX *mont_p) {
|
377
376
|
BN_CTX_start(ctx);
|
378
377
|
BIGNUM *p_minus_2 = BN_CTX_get(ctx);
|
379
|
-
int ok = p_minus_2 != NULL &&
|
380
|
-
BN_copy(p_minus_2, p) &&
|
378
|
+
int ok = p_minus_2 != NULL && BN_copy(p_minus_2, p) &&
|
381
379
|
BN_sub_word(p_minus_2, 2) &&
|
382
380
|
BN_mod_exp_mont(out, a, p_minus_2, p, ctx, mont_p);
|
383
381
|
BN_CTX_end(ctx);
|
@@ -388,8 +386,7 @@ int bn_mod_inverse_secret_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p,
|
|
388
386
|
BN_CTX *ctx, const BN_MONT_CTX *mont_p) {
|
389
387
|
BN_CTX_start(ctx);
|
390
388
|
BIGNUM *p_minus_2 = BN_CTX_get(ctx);
|
391
|
-
int ok = p_minus_2 != NULL &&
|
392
|
-
BN_copy(p_minus_2, p) &&
|
389
|
+
int ok = p_minus_2 != NULL && BN_copy(p_minus_2, p) &&
|
393
390
|
BN_sub_word(p_minus_2, 2) &&
|
394
391
|
BN_mod_exp_mont_consttime(out, a, p_minus_2, p, ctx, mont_p);
|
395
392
|
BN_CTX_end(ctx);
|
data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{gcd_extra.c.inc → gcd_extra.cc.inc}
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* Copyright
|
1
|
+
/* Copyright 2018 The BoringSSL Authors
|
2
2
|
*
|
3
3
|
* Permission to use, copy, modify, and/or distribute this software for any
|
4
4
|
* purpose with or without fee is hereby granted, provided that the above
|
@@ -35,7 +35,7 @@ static void maybe_rshift1_words_carry(BN_ULONG *a, BN_ULONG carry,
|
|
35
35
|
maybe_rshift1_words(a, mask, tmp, num);
|
36
36
|
if (num != 0) {
|
37
37
|
carry &= mask;
|
38
|
-
a[num - 1] |= carry << (BN_BITS2-1);
|
38
|
+
a[num - 1] |= carry << (BN_BITS2 - 1);
|
39
39
|
}
|
40
40
|
}
|
41
41
|
|
@@ -61,25 +61,27 @@ static int bn_gcd_consttime(BIGNUM *r, unsigned *out_shift, const BIGNUM *x,
|
|
61
61
|
BIGNUM *u = BN_CTX_get(ctx);
|
62
62
|
BIGNUM *v = BN_CTX_get(ctx);
|
63
63
|
BIGNUM *tmp = BN_CTX_get(ctx);
|
64
|
-
|
65
|
-
|
66
|
-
!BN_copy(
|
67
|
-
!
|
68
|
-
!bn_resize_words(
|
64
|
+
unsigned x_bits, y_bits, num_iters, shift;
|
65
|
+
if (u == NULL || v == NULL || tmp == NULL || //
|
66
|
+
!BN_copy(u, x) || //
|
67
|
+
!BN_copy(v, y) || //
|
68
|
+
!bn_resize_words(u, width) || //
|
69
|
+
!bn_resize_words(v, width) || //
|
69
70
|
!bn_resize_words(tmp, width)) {
|
70
71
|
goto err;
|
71
72
|
}
|
72
73
|
|
73
74
|
// Each loop iteration halves at least one of |u| and |v|. Thus we need at
|
74
75
|
// most the combined bit width of inputs for at least one value to be zero.
|
75
|
-
|
76
|
-
|
76
|
+
x_bits = x->width * BN_BITS2;
|
77
|
+
y_bits = y->width * BN_BITS2;
|
78
|
+
num_iters = x_bits + y_bits;
|
77
79
|
if (num_iters < x_bits) {
|
78
80
|
OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG);
|
79
81
|
goto err;
|
80
82
|
}
|
81
83
|
|
82
|
-
|
84
|
+
shift = 0;
|
83
85
|
for (unsigned i = 0; i < num_iters; i++) {
|
84
86
|
BN_ULONG both_odd = word_is_odd_mask(u->d[0]) & word_is_odd_mask(v->d[0]);
|
85
87
|
|
@@ -121,8 +123,7 @@ err:
|
|
121
123
|
|
122
124
|
int BN_gcd(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx) {
|
123
125
|
unsigned shift;
|
124
|
-
return bn_gcd_consttime(r, &shift, x, y, ctx) &&
|
125
|
-
BN_lshift(r, r, shift);
|
126
|
+
return bn_gcd_consttime(r, &shift, x, y, ctx) && BN_lshift(r, r, shift);
|
126
127
|
}
|
127
128
|
|
128
129
|
int bn_is_relatively_prime(int *out_relatively_prime, const BIGNUM *x,
|
@@ -131,8 +132,7 @@ int bn_is_relatively_prime(int *out_relatively_prime, const BIGNUM *x,
|
|
131
132
|
BN_CTX_start(ctx);
|
132
133
|
unsigned shift;
|
133
134
|
BIGNUM *gcd = BN_CTX_get(ctx);
|
134
|
-
if (gcd == NULL ||
|
135
|
-
!bn_gcd_consttime(gcd, &shift, x, y, ctx)) {
|
135
|
+
if (gcd == NULL || !bn_gcd_consttime(gcd, &shift, x, y, ctx)) {
|
136
136
|
goto err;
|
137
137
|
}
|
138
138
|
|
@@ -217,23 +217,30 @@ int bn_mod_inverse_consttime(BIGNUM *r, int *out_no_inverse, const BIGNUM *a,
|
|
217
217
|
BIGNUM *D = BN_CTX_get(ctx);
|
218
218
|
BIGNUM *tmp = BN_CTX_get(ctx);
|
219
219
|
BIGNUM *tmp2 = BN_CTX_get(ctx);
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
220
|
+
size_t a_bits, num_iters, n_bits;
|
221
|
+
if (u == NULL || //
|
222
|
+
v == NULL || //
|
223
|
+
A == NULL || //
|
224
|
+
B == NULL || //
|
225
|
+
C == NULL || //
|
226
|
+
D == NULL || //
|
227
|
+
tmp == NULL || //
|
228
|
+
tmp2 == NULL || //
|
229
|
+
!BN_copy(u, a) || //
|
230
|
+
!BN_copy(v, n) || //
|
231
|
+
!BN_one(A) || //
|
225
232
|
!BN_one(D) ||
|
226
233
|
// For convenience, size |u| and |v| equivalently.
|
227
|
-
!bn_resize_words(u, n_width) ||
|
234
|
+
!bn_resize_words(u, n_width) || //
|
228
235
|
!bn_resize_words(v, n_width) ||
|
229
236
|
// |A| and |C| are bounded by |m|.
|
230
|
-
!bn_resize_words(A, n_width) ||
|
237
|
+
!bn_resize_words(A, n_width) || //
|
231
238
|
!bn_resize_words(C, n_width) ||
|
232
239
|
// |B| and |D| are bounded by |a|.
|
233
|
-
!bn_resize_words(B, a_width) ||
|
240
|
+
!bn_resize_words(B, a_width) || //
|
234
241
|
!bn_resize_words(D, a_width) ||
|
235
242
|
// |tmp| and |tmp2| may be used at either size.
|
236
|
-
!bn_resize_words(tmp, n_width) ||
|
243
|
+
!bn_resize_words(tmp, n_width) || //
|
237
244
|
!bn_resize_words(tmp2, n_width)) {
|
238
245
|
goto err;
|
239
246
|
}
|
@@ -242,8 +249,9 @@ int bn_mod_inverse_consttime(BIGNUM *r, int *out_no_inverse, const BIGNUM *a,
|
|
242
249
|
// most the combined bit width of inputs for at least one value to be zero.
|
243
250
|
// |a_bits| and |n_bits| cannot overflow because |bn_wexpand| ensures bit
|
244
251
|
// counts fit in even |int|.
|
245
|
-
|
246
|
-
|
252
|
+
a_bits = a_width * BN_BITS2;
|
253
|
+
n_bits = n_width * BN_BITS2;
|
254
|
+
num_iters = a_bits + n_bits;
|
247
255
|
if (num_iters < a_bits) {
|
248
256
|
OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG);
|
249
257
|
goto err;
|