grpc 1.84.0 → 1.85.0.pre1
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 +40 -27
- data/include/grpc/event_engine/memory_allocator.h +1 -0
- data/include/grpc/grpc.h +3 -0
- data/include/grpc/grpc_security_constants.h +2 -0
- data/include/grpc/impl/channel_arg_names.h +4 -0
- data/src/core/call/call_filters.h +10 -10
- data/src/core/{lib/security/authorization → call}/evaluate_args.cc +22 -1
- data/src/core/{lib/security/authorization → call}/evaluate_args.h +19 -5
- data/src/core/call/filter_fusion.h +15 -15
- data/src/core/call/interception_chain.h +3 -3
- data/src/core/call/metadata_batch.cc +1 -0
- data/src/core/call/metadata_batch.h +45 -33
- data/src/core/call/parsed_metadata.h +3 -3
- data/src/core/call/request_buffer.cc +6 -6
- data/src/core/call/request_buffer.h +1 -1
- data/src/core/channelz/channel_trace.cc +5 -5
- data/src/core/channelz/channel_trace.h +1 -1
- data/src/core/channelz/channelz.cc +9 -9
- data/src/core/channelz/channelz.h +12 -12
- data/src/core/channelz/channelz_registry.cc +10 -10
- data/src/core/channelz/ztrace_collector.h +5 -5
- data/src/core/client_channel/client_channel.cc +4 -4
- data/src/core/client_channel/client_channel_filter.cc +14 -14
- data/src/core/client_channel/global_subchannel_pool.cc +4 -4
- data/src/core/client_channel/subchannel.cc +24 -23
- data/src/core/client_channel/subchannel_stream_client.cc +5 -5
- data/src/core/credentials/call/external/aws_external_account_credentials.cc +7 -7
- data/src/core/credentials/call/external/aws_request_signer.cc +16 -0
- data/src/core/credentials/call/external/external_account_credentials.cc +4 -4
- data/src/core/credentials/call/regional_access_boundary_fetcher.cc +9 -9
- data/src/core/credentials/call/token_fetcher/token_fetcher_credentials.cc +4 -4
- data/src/core/credentials/transport/google_default/google_default_credentials.cc +3 -3
- data/src/core/credentials/transport/ssl/ssl_security_connector.cc +1 -1
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.cc +9 -9
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.h +1 -1
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc +6 -6
- data/src/core/credentials/transport/tls/grpc_tls_certificate_verifier.cc +3 -3
- data/src/core/credentials/transport/tls/grpc_tls_crl_provider.cc +4 -4
- data/src/core/credentials/transport/tls/ssl_utils.cc +10 -0
- data/src/core/credentials/transport/tls/tls_security_connector.cc +10 -10
- data/src/core/credentials/transport/tls/tls_security_connector.h +6 -6
- data/src/core/credentials/transport/tls/tls_utils.h +9 -0
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +1 -1
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +1 -1
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +2 -2
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +1 -1
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +15 -0
- data/src/core/ext/filters/rbac/rbac_filter.h +1 -1
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +5 -5
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +30 -21
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +5 -11
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +14 -11
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +0 -4
- data/src/core/ext/transport/chttp2/transport/frame.h +9 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +12 -9
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +4 -2
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +16 -18
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +2 -1
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.cc +277 -189
- data/src/core/ext/transport/chttp2/transport/http2_server_transport.h +40 -17
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +12 -24
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +3 -29
- data/src/core/ext/transport/chttp2/transport/internal.h +2 -2
- data/src/core/ext/transport/chttp2/transport/parsing.cc +3 -2
- data/src/core/ext/transport/chttp2/transport/read_context.h +96 -3
- data/src/core/ext/transport/chttp2/transport/reclaimer.cc +32 -0
- data/src/core/ext/transport/chttp2/transport/reclaimer.h +64 -0
- data/src/core/ext/transport/chttp2/transport/security_frame.h +8 -8
- data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +17 -9
- data/src/core/ext/transport/chttp2/transport/write_cycle.h +23 -3
- data/src/core/ext/transport/inproc/inproc_transport.cc +5 -5
- data/src/core/ext/upb-gen/grpc/channelz/v1/channelz.upb.h +137 -73
- data/src/core/ext/upb-gen/grpc/channelz/v1/channelz.upb_minitable.c +45 -25
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/altscontext.upb.h +6 -6
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/altscontext.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/altscontext.upb_minitable.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/handshaker.upb.h +46 -26
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/handshaker.upb_minitable.c +17 -14
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/handshaker.upb_minitable.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/transport_security_common.upb.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/transport_security_common.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/gcp/transport_security_common.upb_minitable.h +5 -5
- data/src/core/ext/upb-gen/grpc/health/v1/health.upb.h +329 -0
- data/src/core/ext/upb-gen/grpc/health/v1/health.upb_minitable.c +128 -0
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/health/v1/health.upb_minitable.h +8 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lb/v1/load_balancer.upb.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lb/v1/load_balancer.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lb/v1/load_balancer.upb_minitable.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lookup/v1/rls.upb.h +185 -23
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lookup/v1/rls.upb_minitable.c +20 -12
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lookup/v1/rls.upb_minitable.h +5 -5
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lookup/v1/rls_config.upb.h +58 -42
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lookup/v1/rls_config.upb_minitable.c +17 -12
- data/src/core/ext/upb-gen/{src/proto/grpc → grpc}/lookup/v1/rls_config.upb_minitable.h +5 -5
- data/src/core/ext/upbdefs-gen/grpc/channelz/v1/channelz.upbdefs.c +567 -549
- data/src/core/ext/upbdefs-gen/grpc/lookup/v1/rls_config.upbdefs.c +182 -0
- data/src/core/ext/upbdefs-gen/{src/proto/grpc → grpc}/lookup/v1/rls_config.upbdefs.h +14 -14
- data/src/core/filter/ext_proc/ext_proc_filter.cc +1603 -46
- data/src/core/filter/ext_proc/ext_proc_filter.h +55 -22
- data/src/core/filter/ext_proc/ext_proc_messages.cc +106 -51
- data/src/core/filter/ext_proc/ext_proc_messages.h +36 -9
- data/src/core/handshaker/handshaker.cc +4 -4
- data/src/core/handshaker/http_connect/http_connect_client_handshaker.cc +3 -3
- data/src/core/handshaker/security/pipelined_secure_endpoint.cc +10 -10
- data/src/core/handshaker/security/secure_endpoint.cc +13 -13
- data/src/core/handshaker/security/security_handshaker.cc +6 -6
- data/src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc +4 -4
- data/src/core/lib/channel/channel_args.cc +20 -0
- data/src/core/lib/channel/channel_args.h +17 -17
- data/src/core/lib/channel/promise_based_filter.cc +2 -2
- data/src/core/lib/channel/promise_based_filter.h +66 -27
- 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/ares_resolver.cc +14 -14
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +7 -7
- data/src/core/lib/event_engine/cf_engine/cfsocket_listener.cc +4 -4
- data/src/core/lib/event_engine/default_event_engine.cc +5 -5
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +9 -9
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +16 -14
- data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.cc +6 -6
- data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +1 -1
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +7 -7
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +17 -17
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +3 -3
- data/src/core/lib/event_engine/posix_engine/timer.cc +5 -5
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +5 -5
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +3 -3
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +1 -1
- data/src/core/lib/event_engine/thread_pool/thread_count.cc +1 -1
- data/src/core/lib/event_engine/thread_pool/thread_count.h +3 -3
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +50 -21
- data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc +3 -3
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +3 -3
- data/src/core/lib/event_engine/windows/windows_engine.cc +15 -15
- data/src/core/lib/event_engine/windows/windows_listener.cc +6 -6
- data/src/core/lib/event_engine/work_queue/basic_work_queue.cc +6 -6
- data/src/core/lib/experiments/experiments.cc +48 -0
- data/src/core/lib/experiments/experiments.h +24 -0
- data/src/core/lib/iomgr/buffer_list.cc +3 -3
- data/src/core/lib/iomgr/buffer_list.h +1 -1
- data/src/core/lib/iomgr/combiner.cc +0 -1
- data/src/core/lib/iomgr/ev_apple.cc +4 -4
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +2 -2
- data/src/core/lib/iomgr/tcp_client_posix.cc +3 -3
- data/src/core/lib/iomgr/tcp_posix.cc +7 -7
- data/src/core/lib/promise/activity.cc +1 -1
- data/src/core/lib/promise/activity.h +1 -1
- data/src/core/lib/promise/arena_promise.h +7 -7
- data/src/core/lib/promise/detail/promise_factory.h +8 -8
- data/src/core/lib/promise/detail/promise_like.h +4 -4
- data/src/core/lib/promise/inter_activity_latch.h +6 -6
- data/src/core/lib/promise/inter_activity_pipe.h +1 -1
- data/src/core/lib/promise/observable.h +3 -3
- data/src/core/lib/promise/party.cc +1 -1
- data/src/core/lib/promise/try_seq.h +2 -2
- data/src/core/lib/resource_quota/arena.h +3 -3
- data/src/core/lib/resource_quota/memory_quota.cc +16 -16
- data/src/core/lib/resource_quota/memory_quota.h +1 -1
- data/src/core/lib/resource_quota/thread_quota.cc +3 -3
- data/src/core/lib/security/authorization/audit_logging.cc +5 -5
- data/src/core/lib/security/authorization/authorization_engine.h +1 -1
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +1 -1
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +1 -1
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +1 -1
- data/src/core/lib/security/authorization/matchers.h +1 -1
- data/src/core/lib/surface/call.cc +8 -7
- data/src/core/lib/surface/call.h +3 -3
- data/src/core/lib/surface/call_utils.h +4 -0
- data/src/core/lib/surface/channel.cc +1 -1
- data/src/core/lib/surface/channel.h +1 -1
- data/src/core/lib/surface/channel_init.cc +1 -1
- data/src/core/lib/surface/init.cc +7 -7
- data/src/core/lib/surface/lame_client.cc +1 -1
- data/src/core/lib/surface/legacy_channel.cc +2 -2
- data/src/core/lib/surface/version.cc +1 -1
- data/src/core/lib/transport/transport_framing_endpoint_extension.h +3 -3
- data/src/core/load_balancing/autosharding/autosharding.cc +931 -0
- data/src/core/load_balancing/autosharding/autosharding.h +78 -0
- data/src/core/load_balancing/grpclb/grpclb_client_stats.cc +2 -2
- data/src/core/load_balancing/grpclb/load_balancer_api.cc +1 -1
- data/src/core/load_balancing/grpclb/load_balancer_api.h +3 -1
- data/src/core/load_balancing/health_check_client.cc +7 -7
- data/src/core/load_balancing/lb_policy.cc +1 -1
- data/src/core/load_balancing/oob_backend_metric.cc +5 -5
- data/src/core/load_balancing/outlier_detection/outlier_detection.cc +2 -2
- data/src/core/load_balancing/ring_hash/ring_hash.cc +109 -37
- data/src/core/load_balancing/rls/rls.cc +23 -17
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +10 -10
- data/src/core/load_balancing/xds/cds.cc +6 -5
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +2 -2
- data/src/core/load_balancing/xds/xds_override_host.cc +10 -10
- data/src/core/mitigation_engine/mitigation_engine.h +28 -4
- data/src/core/plugin_registry/grpc_plugin_registry.cc +2 -0
- data/src/core/resolver/dns/dns_resolver.cc +7 -7
- data/src/core/resolver/fake/fake_resolver.cc +5 -5
- data/src/core/resolver/google_c2p/google_c2p_resolver.cc +38 -30
- data/src/core/server/server.cc +30 -30
- data/src/core/server/server.h +4 -3
- data/src/core/server/server_config_selector_filter.cc +3 -3
- data/src/core/server/xds_server_config_fetcher_legacy.cc +15 -15
- data/src/core/telemetry/default_tcp_tracer.cc +1 -1
- data/src/core/telemetry/instrument.cc +30 -16
- data/src/core/telemetry/instrument.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +4 -4
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +2 -2
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +1 -1
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +1 -1
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +5 -5
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +3 -3
- data/src/core/tsi/ssl_transport_security.cc +46 -13
- data/src/core/tsi/ssl_transport_security.h +7 -0
- data/src/core/tsi/ssl_transport_security_utils.cc +16 -6
- data/src/core/util/event_log.cc +3 -3
- data/src/core/util/http_client/httpcli.cc +5 -5
- data/src/core/util/http_client/httpcli.h +1 -1
- data/src/core/util/json/json_object_loader.cc +7 -0
- data/src/core/util/json/json_object_loader.h +17 -2
- data/src/core/util/latent_see.cc +123 -36
- data/src/core/util/latent_see.h +14 -1
- data/src/core/util/mpscq.cc +1 -1
- data/src/core/util/notification.h +4 -4
- data/src/core/util/sync.h +20 -6
- data/src/core/util/table.h +20 -22
- data/src/core/util/work_serializer.cc +2 -2
- data/src/core/xds/grpc/blackboard.cc +4 -3
- data/src/core/xds/grpc/certificate_provider_store.cc +2 -2
- data/src/core/xds/grpc/streaming_call_promise_wrapper.cc +181 -0
- data/src/core/xds/grpc/streaming_call_promise_wrapper.h +213 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc_builder.cc +2 -2
- data/src/core/xds/grpc/xds_client_grpc.cc +8 -8
- data/src/core/xds/grpc/xds_cluster_specifier_plugin.cc +2 -2
- data/src/core/xds/grpc/xds_endpoint.cc +1 -1
- data/src/core/xds/grpc/xds_endpoint_parser.cc +11 -0
- data/src/core/xds/grpc/xds_grpc_service_parser.cc +12 -10
- data/src/core/xds/grpc/xds_http_ext_proc_filter.cc +17 -14
- data/src/core/xds/grpc/xds_matcher.h +2 -2
- data/src/core/xds/grpc/xds_transport_grpc.cc +125 -85
- data/src/core/xds/grpc/xds_transport_grpc.h +19 -4
- data/src/core/xds/xds_client/lrs_client.cc +22 -19
- data/src/core/xds/xds_client/xds_client.cc +19 -16
- data/src/core/xds/xds_client/xds_transport.h +49 -3
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +2 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +3 -0
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/README.md +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +1 -1
- data/third_party/abseil-cpp/absl/algorithm/algorithm.h +34 -2
- data/third_party/abseil-cpp/absl/algorithm/container.h +345 -147
- data/third_party/abseil-cpp/absl/base/attributes.h +67 -44
- data/third_party/abseil-cpp/absl/base/call_once.h +1 -0
- data/third_party/abseil-cpp/absl/base/casts.cc +61 -0
- data/third_party/abseil-cpp/absl/base/casts.h +135 -2
- data/third_party/abseil-cpp/absl/base/config.h +63 -41
- data/third_party/abseil-cpp/absl/base/fast_type_id.h +30 -2
- data/third_party/abseil-cpp/absl/base/internal/dynamic_annotations.h +1 -1
- data/third_party/abseil-cpp/absl/base/internal/hardening.h +136 -0
- data/third_party/abseil-cpp/absl/base/internal/iterator_traits.h +6 -2
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +39 -4
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +6 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h +77 -15
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +3 -4
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +26 -24
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +74 -29
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +1 -11
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +52 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +5 -1
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +5 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h +1 -1
- data/third_party/abseil-cpp/absl/base/macros.h +76 -37
- data/third_party/abseil-cpp/absl/base/nullability.h +5 -5
- data/third_party/abseil-cpp/absl/base/optimization.h +4 -5
- data/third_party/abseil-cpp/absl/base/options.h +46 -18
- data/third_party/abseil-cpp/absl/base/policy_checks.h +5 -5
- data/third_party/abseil-cpp/absl/base/{internal/throw_delegate.cc → throw_delegate.cc} +9 -7
- data/third_party/abseil-cpp/absl/base/{internal/throw_delegate.h → throw_delegate.h} +4 -14
- data/third_party/abseil-cpp/absl/cleanup/cleanup.h +7 -2
- data/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h +3 -2
- data/third_party/abseil-cpp/absl/container/btree_map.h +60 -10
- data/third_party/abseil-cpp/absl/container/btree_set.h +61 -15
- data/third_party/abseil-cpp/absl/container/fixed_array.h +19 -21
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +49 -27
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +50 -26
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +42 -36
- data/third_party/abseil-cpp/absl/container/internal/btree.h +32 -24
- data/third_party/abseil-cpp/absl/container/internal/btree_container.h +30 -22
- data/third_party/abseil-cpp/absl/container/internal/common.h +57 -5
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -1
- data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +40 -36
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +119 -39
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +14 -2
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +14 -22
- data/third_party/abseil-cpp/absl/container/internal/hashtable_control_bytes.h +52 -52
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +7 -7
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +7 -7
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +32 -40
- data/third_party/abseil-cpp/absl/container/internal/layout.h +13 -13
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +95 -72
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +633 -365
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +1016 -749
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set_resize_impl.h +0 -1
- data/third_party/abseil-cpp/absl/container/node_hash_map.h +58 -35
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc +23 -6
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.h +7 -1
- data/third_party/abseil-cpp/absl/crc/internal/crc.cc +4 -6
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +41 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_internal.h +0 -16
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_arm_combined.cc +5 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +304 -188
- data/third_party/abseil-cpp/absl/crc/internal/non_temporal_arm_intrinsics.h +4 -2
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +2 -2
- data/third_party/abseil-cpp/absl/debugging/internal/demangle_rust.h +8 -0
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +4 -4
- data/third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc +15 -1
- data/third_party/abseil-cpp/absl/debugging/internal/examine_stack.h +7 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +12 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +6 -5
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +13 -11
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +14 -7
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +3 -2
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +6 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +14 -8
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +48 -38
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +4 -0
- data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +63 -118
- data/third_party/abseil-cpp/absl/debugging/stacktrace.h +7 -47
- data/third_party/abseil-cpp/absl/debugging/symbolize.cc +20 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +83 -149
- data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +4 -17
- data/third_party/abseil-cpp/absl/debugging/symbolize_unimplemented.inc +4 -4
- data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +2 -4
- data/third_party/abseil-cpp/absl/flags/commandlineflag.h +8 -6
- data/third_party/abseil-cpp/absl/flags/declare.h +9 -0
- data/third_party/abseil-cpp/absl/flags/flag.h +2 -1
- data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.h +1 -1
- data/third_party/abseil-cpp/absl/flags/internal/flag.cc +19 -18
- data/third_party/abseil-cpp/absl/flags/internal/flag.h +33 -34
- data/third_party/abseil-cpp/absl/flags/internal/program_name.cc +2 -2
- data/third_party/abseil-cpp/absl/flags/marshalling.cc +1 -16
- data/third_party/abseil-cpp/absl/flags/marshalling.h +2 -28
- data/third_party/abseil-cpp/absl/flags/reflection.cc +11 -7
- data/third_party/abseil-cpp/absl/flags/usage_config.cc +2 -2
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +22 -19
- data/third_party/abseil-cpp/absl/functional/bind_front.h +7 -1
- data/third_party/abseil-cpp/absl/functional/function_ref.h +125 -20
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +43 -31
- data/third_party/abseil-cpp/absl/functional/internal/front_binder.h +4 -4
- data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +44 -6
- data/third_party/abseil-cpp/absl/hash/hash.h +1 -1
- data/third_party/abseil-cpp/absl/hash/internal/city.cc +39 -51
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +379 -14
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +457 -353
- data/third_party/abseil-cpp/absl/log/absl_vlog_is_on.h +0 -2
- data/third_party/abseil-cpp/absl/log/internal/check_impl.h +2 -1
- data/third_party/abseil-cpp/absl/log/internal/check_op.cc +4 -0
- data/third_party/abseil-cpp/absl/log/internal/check_op.h +128 -50
- data/third_party/abseil-cpp/absl/log/internal/conditions.h +38 -35
- data/third_party/abseil-cpp/absl/log/internal/log_impl.h +108 -110
- data/third_party/abseil-cpp/absl/log/internal/log_message.cc +10 -6
- data/third_party/abseil-cpp/absl/log/internal/log_message.h +19 -1
- data/third_party/abseil-cpp/absl/log/internal/log_sink_set.cc +4 -4
- data/third_party/abseil-cpp/absl/log/internal/nullstream.h +1 -1
- data/third_party/abseil-cpp/absl/log/internal/proto.cc +13 -0
- data/third_party/abseil-cpp/absl/log/internal/strip.h +30 -31
- data/third_party/abseil-cpp/absl/log/internal/structured_proto.cc +5 -5
- data/third_party/abseil-cpp/absl/log/internal/structured_proto.h +6 -5
- data/third_party/abseil-cpp/absl/log/internal/vlog_config.cc +30 -30
- data/third_party/abseil-cpp/absl/log/internal/vlog_config.h +0 -1
- data/third_party/abseil-cpp/absl/log/log.h +2 -2
- data/third_party/abseil-cpp/absl/log/log_entry.cc +263 -0
- data/third_party/abseil-cpp/absl/log/log_entry.h +2 -0
- data/third_party/abseil-cpp/absl/log/vlog_is_on.h +0 -2
- data/third_party/abseil-cpp/absl/memory/memory.h +55 -5
- data/third_party/abseil-cpp/absl/meta/type_traits.h +161 -56
- data/third_party/abseil-cpp/absl/numeric/int128.h +41 -21
- data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +16 -22
- data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +5 -7
- data/third_party/abseil-cpp/absl/numeric/internal/bits.h +32 -4
- data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +9 -9
- data/third_party/abseil-cpp/absl/random/beta_distribution.h +2 -2
- data/third_party/abseil-cpp/absl/random/bit_gen_ref.h +26 -53
- data/third_party/abseil-cpp/absl/random/discrete_distribution.h +1 -1
- data/third_party/abseil-cpp/absl/random/distributions.h +17 -17
- data/third_party/abseil-cpp/absl/random/exponential_distribution.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +8 -21
- data/third_party/abseil-cpp/absl/random/internal/entropy_pool.cc +2 -2
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/generate_real.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/iostream_state_saver.h +2 -2
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +2 -2
- data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +6 -6
- data/third_party/abseil-cpp/absl/random/internal/platform.h +0 -13
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +6 -6
- data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +2 -2
- data/third_party/abseil-cpp/absl/random/internal/salted_seed_seq.h +6 -5
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +5 -31
- data/third_party/abseil-cpp/absl/random/internal/seed_material.h +2 -1
- data/third_party/abseil-cpp/absl/random/internal/traits.h +21 -0
- data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +23 -23
- data/third_party/abseil-cpp/absl/random/mocking_access.h +74 -0
- data/third_party/abseil-cpp/absl/random/uniform_real_distribution.h +1 -1
- data/third_party/abseil-cpp/absl/status/internal/status_internal.cc +63 -18
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +30 -4
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +225 -63
- data/third_party/abseil-cpp/absl/status/status.cc +66 -70
- data/third_party/abseil-cpp/absl/status/status.h +254 -23
- data/third_party/abseil-cpp/absl/status/status_payload_printer.h +3 -2
- data/third_party/abseil-cpp/absl/status/statusor.h +117 -137
- data/third_party/abseil-cpp/absl/strings/ascii.h +10 -6
- data/third_party/abseil-cpp/absl/strings/cord.cc +41 -17
- data/third_party/abseil-cpp/absl/strings/cord.h +26 -17
- data/third_party/abseil-cpp/absl/strings/cord_buffer.h +4 -2
- data/third_party/abseil-cpp/absl/strings/escaping.cc +305 -125
- data/third_party/abseil-cpp/absl/strings/escaping.h +12 -2
- data/third_party/abseil-cpp/absl/strings/internal/append_and_overwrite.h +93 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +6 -6
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +27 -21
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +11 -19
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.cc +6 -0
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.h +1 -0
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +0 -141
- data/third_party/abseil-cpp/absl/strings/internal/escaping.h +2 -24
- data/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h +31 -36
- data/third_party/abseil-cpp/absl/strings/internal/stl_type_traits.h +39 -39
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +14 -22
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +2 -4
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +921 -231
- data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +18 -16
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +16 -12
- data/third_party/abseil-cpp/absl/strings/internal/stringify_sink.h +12 -0
- data/third_party/abseil-cpp/absl/strings/numbers.cc +477 -8
- data/third_party/abseil-cpp/absl/strings/numbers.h +29 -12
- data/third_party/abseil-cpp/absl/strings/resize_and_overwrite.h +198 -0
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +96 -91
- data/third_party/abseil-cpp/absl/strings/str_cat.h +53 -13
- data/third_party/abseil-cpp/absl/strings/str_split.h +14 -9
- data/third_party/abseil-cpp/absl/strings/string_view.h +10 -716
- data/third_party/abseil-cpp/absl/strings/substitute.cc +24 -24
- data/third_party/abseil-cpp/absl/strings/substitute.h +2 -2
- data/third_party/abseil-cpp/absl/synchronization/barrier.cc +1 -1
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc +2 -2
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +24 -3
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +30 -33
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +2 -2
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +5 -0
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +41 -29
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +199 -94
- data/third_party/abseil-cpp/absl/synchronization/notification.cc +5 -5
- data/third_party/abseil-cpp/absl/synchronization/notification.h +1 -1
- data/third_party/abseil-cpp/absl/time/clock.cc +29 -30
- data/third_party/abseil-cpp/absl/time/clock.h +3 -0
- data/third_party/abseil-cpp/absl/time/duration.cc +2 -2
- data/third_party/abseil-cpp/absl/time/format.cc +3 -10
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +12 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +131 -91
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +6 -103
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_name_win.cc +185 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_name_win.h +37 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +10 -15
- data/third_party/abseil-cpp/absl/time/time.cc +4 -4
- data/third_party/abseil-cpp/absl/time/time.h +14 -13
- data/third_party/abseil-cpp/absl/types/compare.h +64 -63
- data/third_party/abseil-cpp/absl/types/internal/span.h +6 -6
- data/third_party/abseil-cpp/absl/types/optional.h +31 -4
- data/third_party/abseil-cpp/absl/types/optional_ref.h +295 -0
- data/third_party/{boringssl-with-bazel/crypto/x509/x_val.cc → abseil-cpp/absl/types/source_location.cc} +4 -14
- data/third_party/abseil-cpp/absl/types/source_location.h +172 -0
- data/third_party/abseil-cpp/absl/types/span.h +67 -38
- data/third_party/abseil-cpp/absl/types/variant.h +75 -18
- data/third_party/abseil-cpp/absl/utility/utility.h +112 -16
- data/third_party/boringssl-with-bazel/crypto/aes/aes.cc +3 -0
- data/third_party/boringssl-with-bazel/crypto/armv8_feature_parsing.h +67 -0
- data/third_party/boringssl-with-bazel/crypto/asn1/a_bitstr.cc +143 -105
- data/third_party/boringssl-with-bazel/crypto/asn1/a_bool.cc +5 -8
- data/third_party/boringssl-with-bazel/crypto/asn1/a_d2i_fp.cc +3 -3
- data/third_party/boringssl-with-bazel/crypto/asn1/a_dup.cc +6 -6
- data/third_party/boringssl-with-bazel/crypto/asn1/a_gentm.cc +33 -12
- data/third_party/boringssl-with-bazel/crypto/asn1/a_i2d_fp.cc +7 -6
- data/third_party/boringssl-with-bazel/crypto/asn1/a_int.cc +80 -52
- data/third_party/boringssl-with-bazel/crypto/asn1/a_mbstr.cc +7 -4
- data/third_party/boringssl-with-bazel/crypto/asn1/a_object.cc +70 -72
- data/third_party/boringssl-with-bazel/crypto/asn1/a_strex.cc +38 -42
- data/third_party/boringssl-with-bazel/crypto/asn1/a_strnid.cc +41 -39
- data/third_party/boringssl-with-bazel/crypto/asn1/a_time.cc +59 -35
- data/third_party/boringssl-with-bazel/crypto/asn1/a_type.cc +275 -15
- data/third_party/boringssl-with-bazel/crypto/asn1/a_utctm.cc +32 -13
- data/third_party/boringssl-with-bazel/crypto/asn1/asn1_lib.cc +128 -30
- data/third_party/boringssl-with-bazel/crypto/asn1/asn_pack.cc +10 -10
- data/third_party/boringssl-with-bazel/crypto/asn1/f_int.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/asn1/f_string.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/asn1/internal.h +261 -115
- data/third_party/boringssl-with-bazel/crypto/asn1/posix_time.cc +8 -5
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_dec.cc +373 -725
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_enc.cc +211 -526
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_fre.cc +22 -19
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_new.cc +26 -24
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_typ.cc +19 -5
- data/third_party/boringssl-with-bazel/crypto/asn1/tasn_utl.cc +47 -51
- data/third_party/boringssl-with-bazel/crypto/base64/base64.cc +14 -15
- data/third_party/boringssl-with-bazel/crypto/bcm_support.h +7 -29
- data/third_party/boringssl-with-bazel/crypto/bio/bio.cc +234 -176
- data/third_party/boringssl-with-bazel/crypto/bio/bio_mem.cc +72 -86
- data/third_party/boringssl-with-bazel/crypto/bio/connect.cc +153 -199
- data/third_party/boringssl-with-bazel/crypto/bio/errno.cc +3 -1
- data/third_party/boringssl-with-bazel/crypto/bio/fd.cc +56 -55
- data/third_party/boringssl-with-bazel/crypto/bio/file.cc +70 -78
- data/third_party/boringssl-with-bazel/crypto/bio/hexdump.cc +6 -4
- data/third_party/boringssl-with-bazel/crypto/bio/internal.h +69 -17
- data/third_party/boringssl-with-bazel/crypto/bio/pair.cc +117 -136
- data/third_party/boringssl-with-bazel/crypto/bio/printf.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/bio/socket.cc +116 -50
- data/third_party/boringssl-with-bazel/crypto/bio/socket_helper.cc +53 -5
- data/third_party/boringssl-with-bazel/crypto/blake2/blake2.cc +9 -5
- data/third_party/boringssl-with-bazel/crypto/bn/bn_asn1.cc +2 -2
- data/third_party/boringssl-with-bazel/crypto/bn/convert.cc +56 -70
- data/third_party/boringssl-with-bazel/crypto/bn/div.cc +102 -0
- data/third_party/boringssl-with-bazel/crypto/bn/exponentiation.cc +26 -42
- data/third_party/boringssl-with-bazel/crypto/bn/sqrt.cc +93 -0
- data/third_party/boringssl-with-bazel/crypto/buf/buf.cc +6 -5
- data/third_party/boringssl-with-bazel/crypto/bytestring/asn1_compat.cc +6 -5
- data/third_party/boringssl-with-bazel/crypto/bytestring/ber.cc +22 -20
- data/third_party/boringssl-with-bazel/crypto/bytestring/cbb.cc +119 -59
- data/third_party/boringssl-with-bazel/crypto/bytestring/cbs.cc +115 -31
- data/third_party/boringssl-with-bazel/crypto/bytestring/internal.h +79 -24
- data/third_party/boringssl-with-bazel/crypto/bytestring/unicode.cc +2 -2
- data/third_party/boringssl-with-bazel/crypto/chacha/chacha.cc +5 -3
- data/third_party/boringssl-with-bazel/crypto/chacha/internal.h +23 -22
- data/third_party/boringssl-with-bazel/crypto/cipher/derive_key.cc +14 -18
- data/third_party/boringssl-with-bazel/crypto/cipher/e_aesctrhmac.cc +73 -58
- data/third_party/boringssl-with-bazel/crypto/cipher/e_aeseax.cc +132 -70
- data/third_party/boringssl-with-bazel/crypto/cipher/e_aesgcmsiv.cc +390 -249
- data/third_party/boringssl-with-bazel/crypto/cipher/e_chacha20poly1305.cc +200 -137
- data/third_party/boringssl-with-bazel/crypto/cipher/e_des.cc +45 -29
- data/third_party/boringssl-with-bazel/crypto/cipher/e_null.cc +9 -5
- data/third_party/boringssl-with-bazel/crypto/cipher/e_rc2.cc +43 -28
- data/third_party/boringssl-with-bazel/crypto/cipher/e_rc4.cc +7 -5
- data/third_party/boringssl-with-bazel/crypto/cipher/e_tls.cc +250 -237
- data/third_party/boringssl-with-bazel/crypto/cipher/get_cipher.cc +12 -12
- data/third_party/boringssl-with-bazel/crypto/cipher/internal.h +59 -59
- data/third_party/boringssl-with-bazel/crypto/cipher/tls_cbc.cc +111 -111
- data/third_party/boringssl-with-bazel/crypto/cms/cms.cc +48 -42
- data/third_party/boringssl-with-bazel/crypto/conf/conf.cc +69 -63
- data/third_party/boringssl-with-bazel/crypto/conf/internal.h +11 -12
- data/third_party/boringssl-with-bazel/crypto/cpu_aarch64_apple.cc +8 -5
- data/third_party/boringssl-with-bazel/crypto/cpu_aarch64_fuchsia.cc +6 -1
- data/third_party/boringssl-with-bazel/crypto/cpu_aarch64_linux.cc +7 -1
- data/third_party/boringssl-with-bazel/crypto/cpu_aarch64_openbsd.cc +7 -21
- data/third_party/boringssl-with-bazel/crypto/cpu_aarch64_sysreg.cc +15 -41
- data/third_party/boringssl-with-bazel/crypto/cpu_aarch64_win.cc +16 -3
- data/third_party/boringssl-with-bazel/crypto/cpu_arm_freebsd.cc +4 -2
- data/third_party/boringssl-with-bazel/crypto/cpu_arm_linux.cc +54 -31
- data/third_party/boringssl-with-bazel/crypto/cpu_arm_linux.h +79 -101
- data/third_party/boringssl-with-bazel/crypto/cpu_intel.cc +51 -45
- data/third_party/boringssl-with-bazel/crypto/crypto.cc +26 -55
- data/third_party/boringssl-with-bazel/crypto/curve25519/curve25519.cc +28 -25
- data/third_party/boringssl-with-bazel/crypto/curve25519/curve25519_tables.h +6 -6
- data/third_party/boringssl-with-bazel/crypto/curve25519/internal.h +14 -15
- data/third_party/boringssl-with-bazel/crypto/curve25519/spake25519.cc +23 -20
- data/third_party/boringssl-with-bazel/crypto/des/des.cc +27 -19
- data/third_party/boringssl-with-bazel/crypto/des/internal.h +4 -9
- data/third_party/boringssl-with-bazel/crypto/dh/dh_asn1.cc +34 -49
- data/third_party/boringssl-with-bazel/crypto/dh/params.cc +44 -41
- data/third_party/boringssl-with-bazel/crypto/digest/digest_extra.cc +87 -40
- data/third_party/boringssl-with-bazel/crypto/dsa/dsa.cc +237 -260
- data/third_party/boringssl-with-bazel/crypto/dsa/dsa_asn1.cc +100 -173
- data/third_party/boringssl-with-bazel/crypto/dsa/internal.h +23 -21
- data/third_party/boringssl-with-bazel/crypto/ec/ec_asn1.cc +181 -209
- data/third_party/boringssl-with-bazel/crypto/ec/ec_derive.cc +26 -28
- data/third_party/boringssl-with-bazel/crypto/ec/hash_to_curve.cc +265 -174
- data/third_party/boringssl-with-bazel/crypto/ec/internal.h +54 -18
- data/third_party/boringssl-with-bazel/crypto/ecdh/ecdh.cc +7 -5
- data/third_party/boringssl-with-bazel/crypto/ecdsa/ecdsa_asn1.cc +50 -70
- data/third_party/boringssl-with-bazel/crypto/ecdsa/ecdsa_p1363.cc +54 -0
- data/third_party/boringssl-with-bazel/crypto/engine/engine.cc +7 -7
- data/third_party/boringssl-with-bazel/crypto/err/err.cc +116 -105
- data/third_party/boringssl-with-bazel/crypto/err/internal.h +8 -21
- data/third_party/boringssl-with-bazel/crypto/evp/evp.cc +238 -166
- data/third_party/boringssl-with-bazel/crypto/evp/evp_asn1.cc +202 -234
- data/third_party/boringssl-with-bazel/crypto/evp/evp_ctx.cc +260 -159
- data/third_party/boringssl-with-bazel/crypto/evp/evp_kem.cc +82 -0
- data/third_party/boringssl-with-bazel/crypto/evp/internal.h +292 -137
- data/third_party/boringssl-with-bazel/crypto/evp/p_dh.cc +198 -25
- data/third_party/boringssl-with-bazel/crypto/evp/p_dsa.cc +333 -0
- data/third_party/boringssl-with-bazel/crypto/evp/p_ec.cc +427 -42
- data/third_party/boringssl-with-bazel/crypto/evp/p_ed25519.cc +270 -14
- data/third_party/boringssl-with-bazel/crypto/evp/p_hkdf.cc +70 -102
- data/third_party/boringssl-with-bazel/crypto/evp/p_mldsa.cc +549 -0
- data/third_party/boringssl-with-bazel/crypto/evp/p_mlkem.cc +485 -0
- data/third_party/boringssl-with-bazel/crypto/evp/p_rsa.cc +666 -158
- data/third_party/boringssl-with-bazel/crypto/evp/p_x25519.cc +290 -28
- data/third_party/boringssl-with-bazel/crypto/evp/p_xwing.cc +273 -0
- data/third_party/boringssl-with-bazel/crypto/evp/pbkdf.cc +14 -7
- data/third_party/boringssl-with-bazel/crypto/evp/print.cc +34 -89
- data/third_party/boringssl-with-bazel/crypto/evp/scrypt.cc +23 -21
- data/third_party/boringssl-with-bazel/crypto/evp/sign.cc +23 -42
- data/third_party/boringssl-with-bazel/crypto/ex_data.cc +40 -41
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/aes.cc.inc +34 -28
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/aes_nohw.cc.inc +119 -121
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/cbc.cc.inc +16 -14
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/cfb.cc.inc +12 -10
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/ctr.cc.inc +7 -5
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/gcm.cc.inc +39 -29
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/gcm_nohw.cc.inc +15 -13
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/internal.h +193 -177
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/key_wrap.cc.inc +5 -3
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/mode_wrappers.cc.inc +7 -3
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/aes/ofb.cc.inc +7 -5
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bcm.cc +24 -19
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bcm_interface.h +512 -384
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/add.cc.inc +7 -5
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/asm/x86_64-gcc.cc.inc +63 -44
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/bn.cc.inc +40 -37
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/bytes.cc.inc +27 -22
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/cmp.cc.inc +9 -7
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/ctx.cc.inc +62 -126
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/div.cc.inc +92 -167
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/div_extra.cc.inc +15 -12
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/exponentiation.cc.inc +96 -93
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/gcd.cc.inc +73 -92
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/gcd_extra.cc.inc +59 -71
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/generic.cc.inc +54 -57
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/internal.h +333 -255
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/jacobi.cc.inc +12 -19
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/montgomery.cc.inc +80 -95
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/montgomery_inv.cc.inc +53 -96
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/mul.cc.inc +58 -419
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/prime.cc.inc +164 -213
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/random.cc.inc +27 -26
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/rsaz_exp.cc.inc +12 -10
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/rsaz_exp.h +47 -49
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/shift.cc.inc +14 -17
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/bn/sqrt.cc.inc +19 -108
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/aead.cc.inc +427 -105
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/cipher.cc.inc +412 -212
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/e_aes.cc.inc +230 -225
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/e_aesccm.cc.inc +115 -84
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cipher/internal.h +374 -27
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/cmac/cmac.cc.inc +28 -23
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/delocate.h +36 -40
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/dh/check.cc.inc +68 -78
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/dh/dh.cc.inc +154 -196
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/dh/internal.h +24 -24
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/digest/digest.cc.inc +40 -69
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/digest/digests.cc.inc +13 -7
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/digest/internal.h +13 -11
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/digest/md32_common.h +86 -81
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/digestsign/digestsign.cc.inc +38 -34
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/ec.cc.inc +187 -196
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/ec_key.cc.inc +196 -154
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/ec_montgomery.cc.inc +65 -125
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/felem.cc.inc +85 -22
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/internal.h +281 -287
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/oct.cc.inc +23 -22
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256.cc.inc +514 -573
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256_internal.h +193 -0
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/scalar.cc.inc +44 -39
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/simple.cc.inc +58 -90
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/simple_mul.cc.inc +39 -34
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/util.cc.inc +6 -3
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/wnaf.cc.inc +23 -20
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ecdh/ecdh.cc.inc +6 -3
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ecdsa/ecdsa.cc.inc +47 -37
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ecdsa/internal.h +5 -10
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/entropy/internal.h +38 -0
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/entropy/jitter.cc.inc +463 -0
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/entropy/sha512.cc.inc +329 -0
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/hkdf/hkdf.cc.inc +8 -6
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/hmac/hmac.cc.inc +19 -16
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/keccak/internal.h +41 -15
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/keccak/keccak.cc.inc +172 -44
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/mldsa/fips_known_values.inc +5 -5
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/mldsa/mldsa.cc.inc +1632 -766
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/mlkem/fips_known_values.inc +5 -5
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/mlkem/mlkem.cc.inc +740 -436
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rand/android_entropy_client.cc.inc +82 -0
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rand/ctrdrbg.cc.inc +240 -53
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rand/internal.h +41 -26
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rand/rand.cc.inc +221 -218
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rsa/internal.h +64 -67
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rsa/padding.cc.inc +49 -57
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rsa/rsa.cc.inc +247 -234
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rsa/rsa_impl.cc.inc +392 -692
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/self_check/fips.cc.inc +10 -10
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/self_check/self_check.cc.inc +479 -449
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/service_indicator/internal.h +34 -11
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/service_indicator/service_indicator.cc.inc +46 -43
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/sha/internal.h +61 -70
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/sha/sha1.cc.inc +27 -13
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/sha/sha256.cc.inc +46 -30
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/sha/sha512.cc.inc +47 -47
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/address.h +98 -73
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/fors.cc.inc +108 -98
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/fors.h +14 -24
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/merkle.cc.inc +94 -91
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/merkle.h +19 -31
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/params.h +156 -56
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/slhdsa.cc.inc +318 -132
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/thash.cc.inc +234 -81
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/thash.h +20 -34
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/wots.cc.inc +97 -96
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/slhdsa/wots.h +10 -20
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/tls/internal.h +2 -16
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/tls/kdf.cc.inc +26 -26
- data/third_party/boringssl-with-bazel/crypto/fuzzer_mode.cc +5 -5
- data/third_party/boringssl-with-bazel/crypto/hpke/hpke.cc +461 -97
- data/third_party/boringssl-with-bazel/crypto/hrss/hrss.cc +153 -149
- data/third_party/boringssl-with-bazel/crypto/hrss/internal.h +9 -13
- data/third_party/boringssl-with-bazel/crypto/internal.h +531 -394
- data/third_party/boringssl-with-bazel/crypto/kyber/internal.h +117 -12
- data/third_party/boringssl-with-bazel/crypto/kyber/kyber.cc +59 -58
- data/third_party/boringssl-with-bazel/crypto/lhash/internal.h +38 -37
- data/third_party/boringssl-with-bazel/crypto/lhash/lhash.cc +68 -65
- data/third_party/boringssl-with-bazel/crypto/md4/md4.cc +19 -6
- data/third_party/boringssl-with-bazel/crypto/md5/internal.h +6 -9
- data/third_party/boringssl-with-bazel/crypto/md5/md5.cc +18 -6
- data/third_party/boringssl-with-bazel/crypto/mem.cc +61 -65
- data/third_party/boringssl-with-bazel/crypto/mem_internal.h +671 -0
- data/third_party/boringssl-with-bazel/crypto/mldsa/mldsa.cc +238 -32
- data/third_party/boringssl-with-bazel/crypto/mlkem/mlkem.cc +21 -65
- data/third_party/boringssl-with-bazel/crypto/obj/obj.cc +132 -157
- data/third_party/boringssl-with-bazel/crypto/obj/obj_dat.h +79 -1
- data/third_party/boringssl-with-bazel/crypto/obj/obj_xref.cc +14 -11
- data/third_party/boringssl-with-bazel/crypto/params_internal.h +30 -0
- data/third_party/boringssl-with-bazel/crypto/pem/internal.h +20 -15
- data/third_party/boringssl-with-bazel/crypto/pem/pem_all.cc +20 -19
- data/third_party/boringssl-with-bazel/crypto/pem/pem_info.cc +72 -76
- data/third_party/boringssl-with-bazel/crypto/pem/pem_lib.cc +215 -217
- data/third_party/boringssl-with-bazel/crypto/pem/pem_oth.cc +6 -6
- data/third_party/boringssl-with-bazel/crypto/pem/pem_pk8.cc +13 -13
- data/third_party/boringssl-with-bazel/crypto/pem/pem_pkey.cc +11 -11
- data/third_party/boringssl-with-bazel/crypto/pkcs7/internal.h +12 -17
- data/third_party/boringssl-with-bazel/crypto/pkcs7/pkcs7.cc +29 -27
- data/third_party/boringssl-with-bazel/crypto/pkcs7/pkcs7_x509.cc +55 -49
- data/third_party/boringssl-with-bazel/crypto/pkcs8/internal.h +21 -26
- data/third_party/boringssl-with-bazel/crypto/pkcs8/p5_pbev2.cc +33 -31
- data/third_party/boringssl-with-bazel/crypto/pkcs8/pkcs8.cc +73 -81
- data/third_party/boringssl-with-bazel/crypto/pkcs8/pkcs8_x509.cc +139 -138
- data/third_party/boringssl-with-bazel/crypto/poly1305/internal.h +3 -7
- data/third_party/boringssl-with-bazel/crypto/poly1305/poly1305.cc +5 -4
- data/third_party/boringssl-with-bazel/crypto/poly1305/poly1305_arm.cc +43 -47
- data/third_party/boringssl-with-bazel/crypto/poly1305/poly1305_vec.cc +29 -26
- data/third_party/boringssl-with-bazel/crypto/pool/internal.h +64 -20
- data/third_party/boringssl-with-bazel/crypto/pool/pool.cc +177 -157
- data/third_party/boringssl-with-bazel/crypto/rand/deterministic.cc +9 -16
- data/third_party/boringssl-with-bazel/crypto/rand/fork_detect.cc +70 -42
- data/third_party/boringssl-with-bazel/crypto/rand/forkunsafe.cc +7 -7
- data/third_party/boringssl-with-bazel/crypto/rand/getentropy.cc +6 -13
- data/third_party/boringssl-with-bazel/crypto/rand/internal.h +16 -4
- data/third_party/boringssl-with-bazel/crypto/rand/ios.cc +4 -11
- data/third_party/boringssl-with-bazel/crypto/rand/rand.cc +11 -9
- data/third_party/boringssl-with-bazel/crypto/rand/trusty.cc +4 -11
- data/third_party/boringssl-with-bazel/crypto/rand/urandom.cc +16 -195
- data/third_party/boringssl-with-bazel/crypto/rand/windows.cc +12 -19
- data/third_party/boringssl-with-bazel/crypto/refcount.cc +7 -17
- data/third_party/boringssl-with-bazel/crypto/rsa/internal.h +22 -7
- data/third_party/boringssl-with-bazel/crypto/rsa/rsa_asn1.cc +199 -78
- data/third_party/boringssl-with-bazel/crypto/rsa/rsa_crypt.cc +49 -50
- data/third_party/boringssl-with-bazel/crypto/rsa/rsa_extra.cc +11 -0
- data/third_party/boringssl-with-bazel/crypto/rsa/rsa_print.cc +4 -6
- data/third_party/boringssl-with-bazel/crypto/sha/sha1.cc +3 -0
- data/third_party/boringssl-with-bazel/crypto/sha/sha256.cc +3 -1
- data/third_party/boringssl-with-bazel/crypto/sha/sha512.cc +6 -4
- data/third_party/boringssl-with-bazel/crypto/siphash/siphash.cc +2 -0
- data/third_party/boringssl-with-bazel/crypto/slhdsa/slhdsa.cc +43 -6
- data/third_party/boringssl-with-bazel/crypto/spake2plus/internal.h +31 -31
- data/third_party/boringssl-with-bazel/crypto/spake2plus/spake2plus.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/stack/stack.cc +89 -130
- data/third_party/boringssl-with-bazel/crypto/thread.cc +14 -14
- data/third_party/boringssl-with-bazel/crypto/thread_none.cc +10 -13
- data/third_party/boringssl-with-bazel/crypto/thread_pthread.cc +22 -35
- data/third_party/boringssl-with-bazel/crypto/thread_win.cc +29 -40
- data/third_party/boringssl-with-bazel/crypto/trust_token/internal.h +81 -88
- data/third_party/boringssl-with-bazel/crypto/trust_token/pmbtoken.cc +160 -144
- data/third_party/boringssl-with-bazel/crypto/trust_token/trust_token.cc +96 -80
- data/third_party/boringssl-with-bazel/crypto/trust_token/voprf.cc +90 -87
- data/third_party/boringssl-with-bazel/crypto/x509/a_digest.cc +5 -5
- data/third_party/boringssl-with-bazel/crypto/x509/a_sign.cc +51 -48
- data/third_party/boringssl-with-bazel/crypto/x509/a_verify.cc +30 -34
- data/third_party/boringssl-with-bazel/crypto/x509/algorithm.cc +47 -16
- data/third_party/boringssl-with-bazel/crypto/x509/asn1_gen.cc +41 -43
- data/third_party/boringssl-with-bazel/crypto/x509/by_dir.cc +183 -237
- data/third_party/boringssl-with-bazel/crypto/x509/by_file.cc +29 -30
- data/third_party/boringssl-with-bazel/crypto/x509/internal.h +276 -180
- data/third_party/boringssl-with-bazel/crypto/x509/name_print.cc +15 -13
- data/third_party/boringssl-with-bazel/crypto/x509/policy.cc +415 -525
- data/third_party/boringssl-with-bazel/crypto/x509/rsa_pss.cc +94 -271
- data/third_party/boringssl-with-bazel/crypto/x509/t_crl.cc +11 -8
- data/third_party/boringssl-with-bazel/crypto/x509/t_req.cc +26 -23
- data/third_party/boringssl-with-bazel/crypto/x509/t_x509.cc +26 -22
- data/third_party/boringssl-with-bazel/crypto/x509/t_x509a.cc +3 -1
- data/third_party/boringssl-with-bazel/crypto/x509/v3_akey.cc +69 -76
- data/third_party/boringssl-with-bazel/crypto/x509/v3_akeya.cc +2 -2
- data/third_party/boringssl-with-bazel/crypto/x509/v3_alt.cc +112 -69
- data/third_party/boringssl-with-bazel/crypto/x509/v3_bcons.cc +15 -14
- data/third_party/boringssl-with-bazel/crypto/x509/v3_bitst.cc +16 -18
- data/third_party/boringssl-with-bazel/crypto/x509/v3_conf.cc +62 -67
- data/third_party/boringssl-with-bazel/crypto/x509/v3_cpols.cc +143 -170
- data/third_party/boringssl-with-bazel/crypto/x509/v3_crld.cc +121 -165
- data/third_party/boringssl-with-bazel/crypto/x509/v3_enum.cc +13 -12
- data/third_party/boringssl-with-bazel/crypto/x509/v3_extku.cc +17 -34
- data/third_party/boringssl-with-bazel/crypto/x509/v3_genn.cc +20 -10
- data/third_party/boringssl-with-bazel/crypto/x509/v3_ia5.cc +22 -18
- data/third_party/boringssl-with-bazel/crypto/x509/v3_info.cc +45 -47
- data/third_party/boringssl-with-bazel/crypto/x509/v3_int.cc +35 -33
- data/third_party/boringssl-with-bazel/crypto/x509/v3_lib.cc +106 -61
- data/third_party/boringssl-with-bazel/crypto/x509/v3_ncons.cc +642 -358
- data/third_party/boringssl-with-bazel/crypto/x509/v3_ocsp.cc +25 -22
- data/third_party/boringssl-with-bazel/crypto/x509/v3_pcons.cc +15 -14
- data/third_party/boringssl-with-bazel/crypto/x509/v3_pmaps.cc +16 -15
- data/third_party/boringssl-with-bazel/crypto/x509/v3_prn.cc +6 -6
- data/third_party/boringssl-with-bazel/crypto/x509/v3_purp.cc +150 -137
- data/third_party/boringssl-with-bazel/crypto/x509/v3_skey.cc +23 -26
- data/third_party/boringssl-with-bazel/crypto/x509/v3_utl.cc +151 -178
- data/third_party/boringssl-with-bazel/crypto/x509/x509.cc +1 -1
- data/third_party/boringssl-with-bazel/crypto/x509/x509_att.cc +32 -30
- data/third_party/boringssl-with-bazel/crypto/x509/x509_cmp.cc +95 -88
- data/third_party/boringssl-with-bazel/crypto/x509/x509_d2.cc +9 -9
- data/third_party/boringssl-with-bazel/crypto/x509/x509_def.cc +6 -8
- data/third_party/boringssl-with-bazel/crypto/x509/x509_ext.cc +46 -24
- data/third_party/boringssl-with-bazel/crypto/x509/x509_lu.cc +211 -195
- data/third_party/boringssl-with-bazel/crypto/x509/x509_obj.cc +20 -16
- data/third_party/boringssl-with-bazel/crypto/x509/x509_req.cc +37 -46
- data/third_party/boringssl-with-bazel/crypto/x509/x509_set.cc +62 -90
- data/third_party/boringssl-with-bazel/crypto/x509/x509_trs.cc +18 -13
- data/third_party/boringssl-with-bazel/crypto/x509/x509_v3.cc +33 -33
- data/third_party/boringssl-with-bazel/crypto/x509/x509_vfy.cc +109 -110
- data/third_party/boringssl-with-bazel/crypto/x509/x509_vpm.cc +56 -47
- data/third_party/boringssl-with-bazel/crypto/x509/x509cset.cc +27 -40
- data/third_party/boringssl-with-bazel/crypto/x509/x509name.cc +77 -67
- data/third_party/boringssl-with-bazel/crypto/x509/x509rset.cc +5 -17
- data/third_party/boringssl-with-bazel/crypto/x509/x509spki.cc +13 -13
- data/third_party/boringssl-with-bazel/crypto/x509/x_algor.cc +131 -24
- data/third_party/boringssl-with-bazel/crypto/x509/x_all.cc +72 -39
- data/third_party/boringssl-with-bazel/crypto/x509/x_attrib.cc +10 -4
- data/third_party/boringssl-with-bazel/crypto/x509/x_crl.cc +77 -44
- data/third_party/boringssl-with-bazel/crypto/x509/x_exten.cc +6 -0
- data/third_party/boringssl-with-bazel/crypto/x509/x_name.cc +311 -383
- data/third_party/boringssl-with-bazel/crypto/x509/x_pubkey.cc +129 -82
- data/third_party/boringssl-with-bazel/crypto/x509/x_req.cc +11 -6
- data/third_party/boringssl-with-bazel/crypto/x509/x_sig.cc +4 -4
- data/third_party/boringssl-with-bazel/crypto/x509/x_spki.cc +11 -1
- data/third_party/boringssl-with-bazel/crypto/x509/x_x509.cc +285 -280
- data/third_party/boringssl-with-bazel/crypto/x509/x_x509a.cc +60 -60
- data/third_party/boringssl-with-bazel/crypto/xwing/xwing.cc +257 -0
- data/third_party/boringssl-with-bazel/gen/boringssl_prefix_symbols_internal_x86_64_win_asm.inc +301 -0
- data/third_party/boringssl-with-bazel/gen/boringssl_prefix_symbols_internal_x86_win_asm.inc +301 -0
- data/third_party/boringssl-with-bazel/gen/crypto/err_data.cc +526 -500
- data/third_party/boringssl-with-bazel/include/openssl/aead.h +286 -114
- data/third_party/boringssl-with-bazel/include/openssl/aes.h +43 -43
- data/third_party/boringssl-with-bazel/include/openssl/asm_base.h +29 -16
- data/third_party/boringssl-with-bazel/include/openssl/asn1.h +641 -631
- data/third_party/boringssl-with-bazel/include/openssl/asn1t.h +7 -9
- data/third_party/boringssl-with-bazel/include/openssl/base.h +34 -54
- data/third_party/boringssl-with-bazel/include/openssl/base64.h +30 -30
- data/third_party/boringssl-with-bazel/include/openssl/bio.h +373 -316
- data/third_party/boringssl-with-bazel/include/openssl/blake2.h +15 -11
- data/third_party/boringssl-with-bazel/include/openssl/blowfish.h +10 -3
- data/third_party/boringssl-with-bazel/include/openssl/bn.h +298 -306
- data/third_party/boringssl-with-bazel/include/openssl/buf.h +14 -14
- data/third_party/boringssl-with-bazel/include/openssl/bytestring.h +272 -207
- data/third_party/boringssl-with-bazel/include/openssl/cast.h +45 -8
- data/third_party/boringssl-with-bazel/include/openssl/chacha.h +3 -3
- data/third_party/boringssl-with-bazel/include/openssl/cipher.h +334 -152
- data/third_party/boringssl-with-bazel/include/openssl/cmac.h +13 -13
- data/third_party/boringssl-with-bazel/include/openssl/cms.h +35 -34
- data/third_party/boringssl-with-bazel/include/openssl/conf.h +15 -14
- data/third_party/boringssl-with-bazel/include/openssl/crypto.h +15 -13
- data/third_party/boringssl-with-bazel/include/openssl/ctrdrbg.h +49 -15
- data/third_party/boringssl-with-bazel/include/openssl/curve25519.h +24 -24
- data/third_party/boringssl-with-bazel/include/openssl/des.h +22 -16
- data/third_party/boringssl-with-bazel/include/openssl/dh.h +95 -95
- data/third_party/boringssl-with-bazel/include/openssl/digest.h +140 -71
- data/third_party/boringssl-with-bazel/include/openssl/dsa.h +101 -101
- data/third_party/boringssl-with-bazel/include/openssl/ec.h +143 -119
- data/third_party/boringssl-with-bazel/include/openssl/ec_key.h +97 -97
- data/third_party/boringssl-with-bazel/include/openssl/ecdh.h +9 -9
- data/third_party/boringssl-with-bazel/include/openssl/ecdsa.h +89 -46
- data/third_party/boringssl-with-bazel/include/openssl/engine.h +5 -5
- data/third_party/boringssl-with-bazel/include/openssl/err.h +73 -71
- data/third_party/boringssl-with-bazel/include/openssl/evp.h +824 -344
- data/third_party/boringssl-with-bazel/include/openssl/evp_errors.h +9 -2
- data/third_party/boringssl-with-bazel/include/openssl/ex_data.h +27 -32
- data/third_party/boringssl-with-bazel/include/openssl/hkdf.h +6 -6
- data/third_party/boringssl-with-bazel/include/openssl/hmac.h +31 -31
- data/third_party/boringssl-with-bazel/include/openssl/hpke.h +133 -117
- data/third_party/boringssl-with-bazel/include/openssl/hrss.h +14 -8
- data/third_party/boringssl-with-bazel/include/openssl/kdf.h +20 -19
- data/third_party/boringssl-with-bazel/include/openssl/lhash.h +4 -25
- data/third_party/boringssl-with-bazel/include/openssl/md4.h +14 -7
- data/third_party/boringssl-with-bazel/include/openssl/md5.h +7 -7
- data/third_party/boringssl-with-bazel/include/openssl/mem.h +38 -38
- data/third_party/boringssl-with-bazel/include/openssl/mldsa.h +380 -24
- data/third_party/boringssl-with-bazel/include/openssl/mlkem.h +43 -43
- data/third_party/boringssl-with-bazel/include/openssl/nid.h +1297 -2
- data/third_party/boringssl-with-bazel/include/openssl/obj.h +49 -49
- data/third_party/boringssl-with-bazel/include/openssl/opensslconf.h +30 -0
- data/third_party/boringssl-with-bazel/include/openssl/params.h +42 -0
- data/third_party/boringssl-with-bazel/include/openssl/pem.h +39 -30
- data/third_party/boringssl-with-bazel/include/openssl/pkcs7.h +40 -40
- data/third_party/boringssl-with-bazel/include/openssl/pkcs8.h +69 -63
- data/third_party/boringssl-with-bazel/include/openssl/poly1305.h +8 -5
- data/third_party/boringssl-with-bazel/include/openssl/pool.h +54 -25
- data/third_party/boringssl-with-bazel/include/openssl/posix_time.h +6 -6
- data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols.h +7866 -0
- data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols_internal_S.h +585 -0
- data/third_party/boringssl-with-bazel/include/openssl/prefix_symbols_internal_c.h +305 -0
- data/third_party/boringssl-with-bazel/include/openssl/rand.h +18 -18
- data/third_party/boringssl-with-bazel/include/openssl/rc4.h +4 -4
- data/third_party/boringssl-with-bazel/include/openssl/ripemd.h +15 -10
- data/third_party/boringssl-with-bazel/include/openssl/rsa.h +272 -235
- data/third_party/boringssl-with-bazel/include/openssl/service_indicator.h +4 -81
- data/third_party/boringssl-with-bazel/include/openssl/sha.h +43 -166
- data/third_party/boringssl-with-bazel/include/openssl/sha2.h +201 -0
- data/third_party/boringssl-with-bazel/include/openssl/slhdsa.h +100 -48
- data/third_party/boringssl-with-bazel/include/openssl/span.h +190 -75
- data/third_party/boringssl-with-bazel/include/openssl/ssl.h +2168 -1567
- data/third_party/boringssl-with-bazel/include/openssl/ssl3.h +11 -69
- data/third_party/boringssl-with-bazel/include/openssl/stack.h +135 -80
- data/third_party/boringssl-with-bazel/include/openssl/target.h +13 -1
- data/third_party/boringssl-with-bazel/include/openssl/thread.h +0 -10
- data/third_party/boringssl-with-bazel/include/openssl/tls1.h +31 -310
- data/third_party/boringssl-with-bazel/include/openssl/tls_prf.h +47 -0
- data/third_party/boringssl-with-bazel/include/openssl/trust_token.h +97 -92
- data/third_party/boringssl-with-bazel/include/openssl/type_check.h +1 -1
- data/third_party/boringssl-with-bazel/include/openssl/x509.h +1805 -1857
- data/third_party/boringssl-with-bazel/include/openssl/x509v3.h +1 -1
- data/third_party/boringssl-with-bazel/include/openssl/xwing.h +115 -0
- data/third_party/boringssl-with-bazel/ssl/bio_ssl.cc +24 -19
- data/third_party/boringssl-with-bazel/ssl/d1_both.cc +59 -57
- data/third_party/boringssl-with-bazel/ssl/d1_lib.cc +53 -42
- data/third_party/boringssl-with-bazel/ssl/d1_pkt.cc +4 -4
- data/third_party/boringssl-with-bazel/ssl/d1_srtp.cc +2 -2
- data/third_party/boringssl-with-bazel/ssl/dtls_method.cc +10 -10
- data/third_party/boringssl-with-bazel/ssl/dtls_record.cc +6 -6
- data/third_party/boringssl-with-bazel/ssl/encrypted_client_hello.cc +61 -71
- data/third_party/boringssl-with-bazel/ssl/extensions.cc +967 -366
- data/third_party/boringssl-with-bazel/ssl/handoff.cc +77 -38
- data/third_party/boringssl-with-bazel/ssl/handshake.cc +63 -30
- data/third_party/boringssl-with-bazel/ssl/handshake_client.cc +129 -85
- data/third_party/boringssl-with-bazel/ssl/handshake_server.cc +116 -68
- data/third_party/boringssl-with-bazel/ssl/internal.h +983 -1207
- data/third_party/boringssl-with-bazel/ssl/s3_both.cc +34 -29
- data/third_party/boringssl-with-bazel/ssl/s3_lib.cc +4 -3
- data/third_party/boringssl-with-bazel/ssl/s3_pkt.cc +12 -12
- data/third_party/boringssl-with-bazel/ssl/ssl_aead_ctx.cc +5 -5
- data/third_party/boringssl-with-bazel/ssl/ssl_asn1.cc +114 -59
- data/third_party/boringssl-with-bazel/ssl/ssl_buffer.cc +17 -18
- data/third_party/boringssl-with-bazel/ssl/ssl_cert.cc +99 -61
- data/third_party/boringssl-with-bazel/ssl/ssl_cipher.cc +143 -134
- data/third_party/boringssl-with-bazel/ssl/ssl_credential.cc +188 -90
- data/third_party/boringssl-with-bazel/ssl/ssl_file.cc +132 -225
- data/third_party/boringssl-with-bazel/ssl/ssl_key_share.cc +79 -7
- data/third_party/boringssl-with-bazel/ssl/ssl_lib.cc +698 -302
- data/third_party/boringssl-with-bazel/ssl/ssl_privkey.cc +102 -45
- data/third_party/boringssl-with-bazel/ssl/ssl_session.cc +117 -102
- data/third_party/boringssl-with-bazel/ssl/ssl_transcript.cc +3 -3
- data/third_party/boringssl-with-bazel/ssl/ssl_versions.cc +24 -24
- data/third_party/boringssl-with-bazel/ssl/ssl_x509.cc +184 -170
- data/third_party/boringssl-with-bazel/ssl/t1_enc.cc +12 -10
- data/third_party/boringssl-with-bazel/ssl/tls13_both.cc +86 -54
- data/third_party/boringssl-with-bazel/ssl/tls13_client.cc +176 -90
- data/third_party/boringssl-with-bazel/ssl/tls13_enc.cc +166 -112
- data/third_party/boringssl-with-bazel/ssl/tls13_server.cc +188 -97
- data/third_party/boringssl-with-bazel/ssl/tls_method.cc +23 -23
- data/third_party/boringssl-with-bazel/ssl/tls_record.cc +17 -14
- data/third_party/boringssl-with-bazel/third_party/fiat/bedrock_unverified_bareminimum.c.inc +47 -0
- data/third_party/boringssl-with-bazel/third_party/fiat/bedrock_unverified_platform.c.inc +137 -0
- data/third_party/boringssl-with-bazel/third_party/fiat/curve25519_64_adx.h +37 -33
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_64.h +4 -93
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_64_msvc.h +4 -69
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_field_32.br.c.inc +71 -0
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_field_64.br.c.inc +84 -0
- data/third_party/boringssl-with-bazel/third_party/fiat/p256_point.br.c.inc +166 -0
- metadata +77 -52
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +0 -240
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +0 -56
- data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb.h +0 -157
- data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb_minitable.c +0 -72
- data/src/core/ext/upbdefs-gen/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +0 -181
- data/third_party/abseil-cpp/absl/base/internal/identity.h +0 -39
- data/third_party/abseil-cpp/absl/base/internal/nullability_deprecated.h +0 -106
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +0 -105
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h +0 -50
- data/third_party/abseil-cpp/absl/strings/string_view.cc +0 -257
- data/third_party/boringssl-with-bazel/crypto/evp/p_dh_asn1.cc +0 -142
- data/third_party/boringssl-with-bazel/crypto/evp/p_dsa_asn1.cc +0 -279
- data/third_party/boringssl-with-bazel/crypto/evp/p_ec_asn1.cc +0 -286
- data/third_party/boringssl-with-bazel/crypto/evp/p_ed25519_asn1.cc +0 -225
- data/third_party/boringssl-with-bazel/crypto/evp/p_rsa_asn1.cc +0 -198
- data/third_party/boringssl-with-bazel/crypto/evp/p_x25519_asn1.cc +0 -237
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p224-64.cc.inc +0 -1163
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256-nistz.cc.inc +0 -741
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/ec/p256-nistz.h +0 -207
- data/third_party/boringssl-with-bazel/crypto/fipsmodule/rsa/blinding.cc.inc +0 -147
- data/third_party/boringssl-with-bazel/crypto/rand/getrandom_fillin.h +0 -64
- data/third_party/boringssl-with-bazel/crypto/rand/passive.cc +0 -178
- data/third_party/boringssl-with-bazel/crypto/x509/ext_dat.h +0 -92
- data/third_party/boringssl-with-bazel/include/openssl/bcm_public.h +0 -82
- data/third_party/boringssl-with-bazel/include/openssl/experimental/kyber.h +0 -146
|
@@ -19,16 +19,23 @@
|
|
|
19
19
|
#include <openssl/cipher.h>
|
|
20
20
|
#include <openssl/crypto.h>
|
|
21
21
|
#include <openssl/err.h>
|
|
22
|
+
#include <openssl/span.h>
|
|
22
23
|
|
|
23
24
|
#include "../fipsmodule/aes/internal.h"
|
|
24
25
|
#include "../fipsmodule/cipher/internal.h"
|
|
25
26
|
#include "../internal.h"
|
|
26
27
|
|
|
27
28
|
|
|
29
|
+
using namespace bssl;
|
|
30
|
+
|
|
28
31
|
#define EVP_AEAD_AES_GCM_SIV_NONCE_LEN 12
|
|
29
32
|
#define EVP_AEAD_AES_GCM_SIV_TAG_LEN 16
|
|
30
33
|
|
|
31
34
|
namespace {
|
|
35
|
+
void inc_counter(uint8_t tag[16], uint32_t by) {
|
|
36
|
+
CRYPTO_store_u32_le(tag, CRYPTO_load_u32_le(tag) + by);
|
|
37
|
+
}
|
|
38
|
+
|
|
32
39
|
// TODO(davidben): AES-GCM-SIV assembly is not correct for Windows. It must save
|
|
33
40
|
// and restore xmm6 through xmm15.
|
|
34
41
|
#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) && \
|
|
@@ -44,63 +51,63 @@ struct aead_aes_gcm_siv_asm_ctx {
|
|
|
44
51
|
|
|
45
52
|
// The assembly code assumes 8-byte alignment of the EVP_AEAD_CTX's state, and
|
|
46
53
|
// aligns to 16 bytes itself.
|
|
47
|
-
static_assert(sizeof(((EVP_AEAD_CTX *)
|
|
48
|
-
sizeof(struct aead_aes_gcm_siv_asm_ctx),
|
|
54
|
+
static_assert(sizeof(((EVP_AEAD_CTX *)nullptr)->state) >=
|
|
55
|
+
sizeof(struct aead_aes_gcm_siv_asm_ctx) + 8,
|
|
49
56
|
"AEAD state is too small");
|
|
50
57
|
static_assert(alignof(union evp_aead_ctx_st_state) >= 8,
|
|
51
58
|
"AEAD state has insufficient alignment");
|
|
52
59
|
|
|
53
60
|
extern "C" {
|
|
54
|
-
// aes128gcmsiv_aes_ks writes an AES-128 key schedule for
|
|
55
|
-
//
|
|
61
|
+
// aes128gcmsiv_aes_ks writes an AES-128 key schedule for `key` to
|
|
62
|
+
// `out_expanded_key`.
|
|
56
63
|
extern void aes128gcmsiv_aes_ks(const uint8_t key[16],
|
|
57
64
|
uint8_t out_expanded_key[16 * 15]);
|
|
58
65
|
|
|
59
|
-
// aes256gcmsiv_aes_ks writes an AES-256 key schedule for
|
|
60
|
-
//
|
|
66
|
+
// aes256gcmsiv_aes_ks writes an AES-256 key schedule for `key` to
|
|
67
|
+
// `out_expanded_key`.
|
|
61
68
|
extern void aes256gcmsiv_aes_ks(const uint8_t key[32],
|
|
62
69
|
uint8_t out_expanded_key[16 * 15]);
|
|
63
70
|
|
|
64
|
-
// aesgcmsiv_polyval_horner updates the POLYVAL value in
|
|
65
|
-
// include a number (
|
|
66
|
-
// the POLYVAL key in
|
|
71
|
+
// aesgcmsiv_polyval_horner updates the POLYVAL value in `in_out_poly` to
|
|
72
|
+
// include a number (`in_blocks`) of 16-byte blocks of data from `in`, given
|
|
73
|
+
// the POLYVAL key in `key`.
|
|
67
74
|
extern void aesgcmsiv_polyval_horner(const uint8_t in_out_poly[16],
|
|
68
75
|
const uint8_t key[16], const uint8_t *in,
|
|
69
76
|
size_t in_blocks);
|
|
70
77
|
|
|
71
|
-
// aesgcmsiv_htable_init writes powers 1..8 of
|
|
78
|
+
// aesgcmsiv_htable_init writes powers 1..8 of `auth_key` to `out_htable`.
|
|
72
79
|
extern void aesgcmsiv_htable_init(uint8_t out_htable[16 * 8],
|
|
73
80
|
const uint8_t auth_key[16]);
|
|
74
81
|
|
|
75
|
-
// aesgcmsiv_htable6_init writes powers 1..6 of
|
|
82
|
+
// aesgcmsiv_htable6_init writes powers 1..6 of `auth_key` to `out_htable`.
|
|
76
83
|
extern void aesgcmsiv_htable6_init(uint8_t out_htable[16 * 6],
|
|
77
84
|
const uint8_t auth_key[16]);
|
|
78
85
|
|
|
79
|
-
// aesgcmsiv_htable_polyval updates the POLYVAL value in
|
|
80
|
-
// include
|
|
81
|
-
// of 16.) It uses the precomputed powers of the key given in
|
|
86
|
+
// aesgcmsiv_htable_polyval updates the POLYVAL value in `in_out_poly` to
|
|
87
|
+
// include `in_len` bytes of data from `in`. (Where `in_len` must be a multiple
|
|
88
|
+
// of 16.) It uses the precomputed powers of the key given in `htable`.
|
|
82
89
|
extern void aesgcmsiv_htable_polyval(const uint8_t htable[16 * 8],
|
|
83
90
|
const uint8_t *in, size_t in_len,
|
|
84
91
|
uint8_t in_out_poly[16]);
|
|
85
92
|
|
|
86
|
-
// aes128gcmsiv_dec decrypts
|
|
87
|
-
//
|
|
93
|
+
// aes128gcmsiv_dec decrypts `in_len` & ~15 bytes from `out` and writes them to
|
|
94
|
+
// `in`. `in` and `out` may be equal, but must not otherwise alias.
|
|
88
95
|
//
|
|
89
|
-
//
|
|
96
|
+
// `in_out_calculated_tag_and_scratch`, on entry, must contain:
|
|
90
97
|
// 1. The current value of the calculated tag, which will be updated during
|
|
91
98
|
// decryption and written back to the beginning of this buffer on exit.
|
|
92
99
|
// 2. The claimed tag, which is needed to derive counter values.
|
|
93
100
|
//
|
|
94
|
-
// While decrypting, the whole of
|
|
101
|
+
// While decrypting, the whole of `in_out_calculated_tag_and_scratch` may be
|
|
95
102
|
// used for other purposes. In order to decrypt and update the POLYVAL value, it
|
|
96
|
-
// uses the expanded key from
|
|
103
|
+
// uses the expanded key from `key` and the table of powers in `htable`.
|
|
97
104
|
extern void aes128gcmsiv_dec(const uint8_t *in, uint8_t *out,
|
|
98
105
|
uint8_t in_out_calculated_tag_and_scratch[16 * 8],
|
|
99
106
|
const uint8_t htable[16 * 6],
|
|
100
107
|
const struct aead_aes_gcm_siv_asm_ctx *key,
|
|
101
108
|
size_t in_len);
|
|
102
109
|
|
|
103
|
-
// aes256gcmsiv_dec acts like
|
|
110
|
+
// aes256gcmsiv_dec acts like `aes128gcmsiv_dec`, but for AES-256.
|
|
104
111
|
extern void aes256gcmsiv_dec(const uint8_t *in, uint8_t *out,
|
|
105
112
|
uint8_t in_out_calculated_tag_and_scratch[16 * 8],
|
|
106
113
|
const uint8_t htable[16 * 6],
|
|
@@ -108,68 +115,68 @@ extern void aes256gcmsiv_dec(const uint8_t *in, uint8_t *out,
|
|
|
108
115
|
size_t in_len);
|
|
109
116
|
|
|
110
117
|
// aes128gcmsiv_kdf performs the AES-GCM-SIV KDF given the expanded key from
|
|
111
|
-
//
|
|
118
|
+
// `key_schedule` and the nonce in `nonce`. Note that, while only 12 bytes of
|
|
112
119
|
// the nonce are used, 16 bytes are read and so the value must be
|
|
113
120
|
// right-padded.
|
|
114
121
|
extern void aes128gcmsiv_kdf(const uint8_t nonce[16],
|
|
115
122
|
uint64_t out_key_material[8],
|
|
116
123
|
const uint8_t *key_schedule);
|
|
117
124
|
|
|
118
|
-
// aes256gcmsiv_kdf acts like
|
|
125
|
+
// aes256gcmsiv_kdf acts like `aes128gcmsiv_kdf`, but for AES-256.
|
|
119
126
|
extern void aes256gcmsiv_kdf(const uint8_t nonce[16],
|
|
120
127
|
uint64_t out_key_material[12],
|
|
121
128
|
const uint8_t *key_schedule);
|
|
122
129
|
|
|
123
130
|
// aes128gcmsiv_aes_ks_enc_x1 performs a key expansion of the AES-128 key in
|
|
124
|
-
//
|
|
125
|
-
// block from
|
|
131
|
+
// `key`, writes the expanded key to `out_expanded_key` and encrypts a single
|
|
132
|
+
// block from `in` to `out`.
|
|
126
133
|
extern void aes128gcmsiv_aes_ks_enc_x1(const uint8_t in[16], uint8_t out[16],
|
|
127
134
|
uint8_t out_expanded_key[16 * 15],
|
|
128
135
|
const uint64_t key[2]);
|
|
129
136
|
|
|
130
|
-
// aes256gcmsiv_aes_ks_enc_x1 acts like
|
|
137
|
+
// aes256gcmsiv_aes_ks_enc_x1 acts like `aes128gcmsiv_aes_ks_enc_x1`, but for
|
|
131
138
|
// AES-256.
|
|
132
139
|
extern void aes256gcmsiv_aes_ks_enc_x1(const uint8_t in[16], uint8_t out[16],
|
|
133
140
|
uint8_t out_expanded_key[16 * 15],
|
|
134
141
|
const uint64_t key[4]);
|
|
135
142
|
|
|
136
|
-
// aes128gcmsiv_ecb_enc_block encrypts a single block from
|
|
137
|
-
// the expanded key in
|
|
143
|
+
// aes128gcmsiv_ecb_enc_block encrypts a single block from `in` to `out` using
|
|
144
|
+
// the expanded key in `expanded_key`.
|
|
138
145
|
extern void aes128gcmsiv_ecb_enc_block(
|
|
139
146
|
const uint8_t in[16], uint8_t out[16],
|
|
140
147
|
const struct aead_aes_gcm_siv_asm_ctx *expanded_key);
|
|
141
148
|
|
|
142
|
-
// aes256gcmsiv_ecb_enc_block acts like
|
|
149
|
+
// aes256gcmsiv_ecb_enc_block acts like `aes128gcmsiv_ecb_enc_block`, but for
|
|
143
150
|
// AES-256.
|
|
144
151
|
extern void aes256gcmsiv_ecb_enc_block(
|
|
145
152
|
const uint8_t in[16], uint8_t out[16],
|
|
146
153
|
const struct aead_aes_gcm_siv_asm_ctx *expanded_key);
|
|
147
154
|
|
|
148
|
-
// aes128gcmsiv_enc_msg_x4 encrypts
|
|
149
|
-
// expanded key from
|
|
150
|
-
// The
|
|
151
|
-
// initial counter is constructed from the given
|
|
155
|
+
// aes128gcmsiv_enc_msg_x4 encrypts `in_len` bytes from `in` to `out` using the
|
|
156
|
+
// expanded key from `key`. (The value of `in_len` must be a multiple of 16.)
|
|
157
|
+
// The `in` and `out` buffers may be equal but must not otherwise overlap. The
|
|
158
|
+
// initial counter is constructed from the given `tag` as required by
|
|
152
159
|
// AES-GCM-SIV.
|
|
153
160
|
extern void aes128gcmsiv_enc_msg_x4(const uint8_t *in, uint8_t *out,
|
|
154
161
|
const uint8_t *tag,
|
|
155
162
|
const struct aead_aes_gcm_siv_asm_ctx *key,
|
|
156
163
|
size_t in_len);
|
|
157
164
|
|
|
158
|
-
// aes256gcmsiv_enc_msg_x4 acts like
|
|
165
|
+
// aes256gcmsiv_enc_msg_x4 acts like `aes128gcmsiv_enc_msg_x4`, but for
|
|
159
166
|
// AES-256.
|
|
160
167
|
extern void aes256gcmsiv_enc_msg_x4(const uint8_t *in, uint8_t *out,
|
|
161
168
|
const uint8_t *tag,
|
|
162
169
|
const struct aead_aes_gcm_siv_asm_ctx *key,
|
|
163
170
|
size_t in_len);
|
|
164
171
|
|
|
165
|
-
// aes128gcmsiv_enc_msg_x8 acts like
|
|
172
|
+
// aes128gcmsiv_enc_msg_x8 acts like `aes128gcmsiv_enc_msg_x4`, but is
|
|
166
173
|
// optimised for longer messages.
|
|
167
174
|
extern void aes128gcmsiv_enc_msg_x8(const uint8_t *in, uint8_t *out,
|
|
168
175
|
const uint8_t *tag,
|
|
169
176
|
const struct aead_aes_gcm_siv_asm_ctx *key,
|
|
170
177
|
size_t in_len);
|
|
171
178
|
|
|
172
|
-
// aes256gcmsiv_enc_msg_x8 acts like
|
|
179
|
+
// aes256gcmsiv_enc_msg_x8 acts like `aes256gcmsiv_enc_msg_x4`, but is
|
|
173
180
|
// optimised for longer messages.
|
|
174
181
|
extern void aes256gcmsiv_enc_msg_x8(const uint8_t *in, uint8_t *out,
|
|
175
182
|
const uint8_t *tag,
|
|
@@ -177,7 +184,7 @@ extern void aes256gcmsiv_enc_msg_x8(const uint8_t *in, uint8_t *out,
|
|
|
177
184
|
size_t in_len);
|
|
178
185
|
}
|
|
179
186
|
|
|
180
|
-
// asm_ctx_from_ctx returns a 16-byte aligned context pointer from
|
|
187
|
+
// asm_ctx_from_ctx returns a 16-byte aligned context pointer from `ctx`.
|
|
181
188
|
struct aead_aes_gcm_siv_asm_ctx *asm_ctx_from_ctx(const EVP_AEAD_CTX *ctx) {
|
|
182
189
|
// ctx->state must already be 8-byte aligned. Thus, at most, we may need to
|
|
183
190
|
// add eight to align it to 16 bytes.
|
|
@@ -221,13 +228,15 @@ int aead_aes_gcm_siv_asm_init(EVP_AEAD_CTX *ctx, const uint8_t *key,
|
|
|
221
228
|
|
|
222
229
|
void aead_aes_gcm_siv_asm_cleanup(EVP_AEAD_CTX *ctx) {}
|
|
223
230
|
|
|
224
|
-
// gcm_siv_asm_polyval evaluates POLYVAL at
|
|
225
|
-
// and AD. The result is written to
|
|
226
|
-
void gcm_siv_asm_polyval(uint8_t out_tag[16], const
|
|
227
|
-
const
|
|
231
|
+
// gcm_siv_asm_polyval evaluates POLYVAL at `auth_key` on the given plaintext
|
|
232
|
+
// and AD. The result is written to `out_tag`.
|
|
233
|
+
void gcm_siv_asm_polyval(uint8_t out_tag[16], Span<const CRYPTO_IOVEC> iovecs,
|
|
234
|
+
Span<const CRYPTO_IVEC> aadvecs,
|
|
228
235
|
const uint8_t auth_key[16], const uint8_t nonce[12]) {
|
|
229
236
|
OPENSSL_memset(out_tag, 0, 16);
|
|
237
|
+
const size_t ad_len = bssl::iovec::TotalLength(aadvecs);
|
|
230
238
|
const size_t ad_blocks = ad_len / 16;
|
|
239
|
+
const size_t in_len = bssl::iovec::TotalLength(iovecs);
|
|
231
240
|
const size_t in_blocks = in_len / 16;
|
|
232
241
|
int htable_init = 0;
|
|
233
242
|
alignas(16) uint8_t htable[16 * 8];
|
|
@@ -237,30 +246,36 @@ void gcm_siv_asm_polyval(uint8_t out_tag[16], const uint8_t *in, size_t in_len,
|
|
|
237
246
|
aesgcmsiv_htable_init(htable, auth_key);
|
|
238
247
|
}
|
|
239
248
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
auto f_whole = [&](const uint8_t *in, size_t len) {
|
|
250
|
+
if (htable_init) {
|
|
251
|
+
aesgcmsiv_htable_polyval(htable, in, len, out_tag);
|
|
252
|
+
} else {
|
|
253
|
+
aesgcmsiv_polyval_horner(out_tag, auth_key, in, len / AES_BLOCK_SIZE);
|
|
254
|
+
}
|
|
255
|
+
return true;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
auto f_final = [&](const uint8_t *in, size_t len) {
|
|
259
|
+
size_t len_whole = (len / AES_BLOCK_SIZE) * AES_BLOCK_SIZE;
|
|
260
|
+
if (len_whole != 0) {
|
|
261
|
+
f_whole(in, len_whole);
|
|
262
|
+
in += len_whole;
|
|
263
|
+
len -= len_whole;
|
|
264
|
+
}
|
|
265
|
+
if (len != 0) {
|
|
266
|
+
uint8_t pad_buf[AES_BLOCK_SIZE];
|
|
267
|
+
OPENSSL_memcpy(pad_buf, in, len);
|
|
268
|
+
OPENSSL_memset(pad_buf + len, 0, AES_BLOCK_SIZE - len);
|
|
269
|
+
aesgcmsiv_polyval_horner(out_tag, auth_key, pad_buf, 1);
|
|
270
|
+
}
|
|
271
|
+
return true;
|
|
272
|
+
};
|
|
252
273
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
} else {
|
|
256
|
-
aesgcmsiv_polyval_horner(out_tag, auth_key, in, in_blocks);
|
|
257
|
-
}
|
|
274
|
+
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(aadvecs, f_whole,
|
|
275
|
+
f_final);
|
|
258
276
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
OPENSSL_memcpy(scratch, &in[in_len & ~15], in_len & 15);
|
|
262
|
-
aesgcmsiv_polyval_horner(out_tag, auth_key, scratch, 1);
|
|
263
|
-
}
|
|
277
|
+
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(iovecs, f_whole,
|
|
278
|
+
f_final);
|
|
264
279
|
|
|
265
280
|
uint8_t length_block[16];
|
|
266
281
|
CRYPTO_store_u64_le(length_block, ad_len * 8);
|
|
@@ -276,16 +291,16 @@ void gcm_siv_asm_polyval(uint8_t out_tag[16], const uint8_t *in, size_t in_len,
|
|
|
276
291
|
|
|
277
292
|
// aead_aes_gcm_siv_asm_crypt_last_block handles the encryption/decryption
|
|
278
293
|
// (same thing in CTR mode) of the final block of a plaintext/ciphertext. It
|
|
279
|
-
// writes
|
|
280
|
-
// derived from
|
|
294
|
+
// writes `total_in_len` & 15 bytes to `out_last_block`, based on an initial
|
|
295
|
+
// counter derived from `tag`.
|
|
281
296
|
void aead_aes_gcm_siv_asm_crypt_last_block(
|
|
282
|
-
int is_128_bit, uint8_t *
|
|
283
|
-
const uint8_t tag[16],
|
|
297
|
+
int is_128_bit, uint8_t *out_last_block, const uint8_t *in_last_block,
|
|
298
|
+
size_t total_in_len, const uint8_t tag[16],
|
|
284
299
|
const struct aead_aes_gcm_siv_asm_ctx *enc_key_expanded) {
|
|
285
300
|
alignas(16) uint8_t counter[16];
|
|
286
301
|
OPENSSL_memcpy(&counter, tag, sizeof(counter));
|
|
287
302
|
counter[15] |= 0x80;
|
|
288
|
-
|
|
303
|
+
inc_counter(counter, static_cast<uint32_t>(total_in_len / 16));
|
|
289
304
|
|
|
290
305
|
if (is_128_bit) {
|
|
291
306
|
aes128gcmsiv_ecb_enc_block(counter, counter, enc_key_expanded);
|
|
@@ -293,23 +308,20 @@ void aead_aes_gcm_siv_asm_crypt_last_block(
|
|
|
293
308
|
aes256gcmsiv_ecb_enc_block(counter, counter, enc_key_expanded);
|
|
294
309
|
}
|
|
295
310
|
|
|
296
|
-
const size_t
|
|
297
|
-
const size_t last_bytes_len = in_len & 15;
|
|
298
|
-
uint8_t *last_bytes_out = &out[last_bytes_offset];
|
|
299
|
-
const uint8_t *last_bytes_in = &in[last_bytes_offset];
|
|
311
|
+
const size_t last_bytes_len = total_in_len & 15;
|
|
300
312
|
for (size_t i = 0; i < last_bytes_len; i++) {
|
|
301
|
-
|
|
313
|
+
out_last_block[i] = in_last_block[i] ^ counter[i];
|
|
302
314
|
}
|
|
303
315
|
}
|
|
304
316
|
|
|
305
317
|
// aead_aes_gcm_siv_kdf calculates the record encryption and authentication
|
|
306
|
-
// keys given the
|
|
318
|
+
// keys given the `nonce`.
|
|
307
319
|
void aead_aes_gcm_siv_kdf(int is_128_bit,
|
|
308
320
|
const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx,
|
|
309
321
|
uint64_t out_record_auth_key[2],
|
|
310
322
|
uint64_t out_record_enc_key[4],
|
|
311
323
|
const uint8_t nonce[12]) {
|
|
312
|
-
alignas(16) uint8_t padded_nonce[16];
|
|
324
|
+
alignas(16) uint8_t padded_nonce[16] = {0};
|
|
313
325
|
OPENSSL_memcpy(padded_nonce, nonce, 12);
|
|
314
326
|
|
|
315
327
|
alignas(16) uint64_t key_material[12];
|
|
@@ -329,13 +341,15 @@ void aead_aes_gcm_siv_kdf(int is_128_bit,
|
|
|
329
341
|
out_record_auth_key[1] = key_material[2];
|
|
330
342
|
}
|
|
331
343
|
|
|
332
|
-
int
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
344
|
+
int aead_aes_gcm_siv_asm_sealv(const EVP_AEAD_CTX *ctx,
|
|
345
|
+
Span<const CRYPTO_IOVEC> iovecs,
|
|
346
|
+
Span<uint8_t> out_tag, size_t *out_tag_len,
|
|
347
|
+
Span<const uint8_t> nonce,
|
|
348
|
+
Span<const CRYPTO_IVEC> aadvecs) {
|
|
337
349
|
const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = asm_ctx_from_ctx(ctx);
|
|
350
|
+
const size_t in_len = bssl::iovec::TotalLength(iovecs);
|
|
338
351
|
const uint64_t in_len_64 = in_len;
|
|
352
|
+
const size_t ad_len = bssl::iovec::TotalLength(aadvecs);
|
|
339
353
|
const uint64_t ad_len_64 = ad_len;
|
|
340
354
|
|
|
341
355
|
if (in_len_64 > (UINT64_C(1) << 36) || ad_len_64 >= (UINT64_C(1) << 61)) {
|
|
@@ -343,12 +357,12 @@ int aead_aes_gcm_siv_asm_seal_scatter(
|
|
|
343
357
|
return 0;
|
|
344
358
|
}
|
|
345
359
|
|
|
346
|
-
if (
|
|
360
|
+
if (out_tag.size() < EVP_AEAD_AES_GCM_SIV_TAG_LEN) {
|
|
347
361
|
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL);
|
|
348
362
|
return 0;
|
|
349
363
|
}
|
|
350
364
|
|
|
351
|
-
if (
|
|
365
|
+
if (nonce.size() != EVP_AEAD_AES_GCM_SIV_NONCE_LEN) {
|
|
352
366
|
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE);
|
|
353
367
|
return 0;
|
|
354
368
|
}
|
|
@@ -356,64 +370,121 @@ int aead_aes_gcm_siv_asm_seal_scatter(
|
|
|
356
370
|
alignas(16) uint64_t record_auth_key[2];
|
|
357
371
|
alignas(16) uint64_t record_enc_key[4];
|
|
358
372
|
aead_aes_gcm_siv_kdf(gcm_siv_ctx->is_128_bit, gcm_siv_ctx, record_auth_key,
|
|
359
|
-
record_enc_key, nonce);
|
|
373
|
+
record_enc_key, nonce.data());
|
|
360
374
|
|
|
361
375
|
alignas(16) uint8_t tag[16] = {0};
|
|
362
|
-
gcm_siv_asm_polyval(tag,
|
|
363
|
-
(
|
|
376
|
+
gcm_siv_asm_polyval(tag, iovecs, aadvecs, (const uint8_t *)record_auth_key,
|
|
377
|
+
nonce.data());
|
|
364
378
|
|
|
365
379
|
struct aead_aes_gcm_siv_asm_ctx enc_key_expanded;
|
|
366
380
|
|
|
367
381
|
if (gcm_siv_ctx->is_128_bit) {
|
|
368
382
|
aes128gcmsiv_aes_ks_enc_x1(tag, tag, &enc_key_expanded.key[0],
|
|
369
383
|
record_enc_key);
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
384
|
+
// Maintain a counter across calls to assembly. The functions internally set
|
|
385
|
+
// the MSB of the last byte, so we only need to update the counter.
|
|
386
|
+
alignas(16) uint8_t counter[16];
|
|
387
|
+
OPENSSL_memcpy(counter, tag, 16);
|
|
388
|
+
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/true>(
|
|
389
|
+
iovecs,
|
|
390
|
+
[&](const uint8_t *in, uint8_t *out, size_t len) {
|
|
391
|
+
if (len >= 128) {
|
|
392
|
+
aes128gcmsiv_enc_msg_x8(in, out, counter, &enc_key_expanded, len);
|
|
393
|
+
} else {
|
|
394
|
+
aes128gcmsiv_enc_msg_x4(in, out, counter, &enc_key_expanded, len);
|
|
395
|
+
}
|
|
396
|
+
inc_counter(counter, static_cast<uint32_t>(len / AES_BLOCK_SIZE));
|
|
397
|
+
return true;
|
|
398
|
+
},
|
|
399
|
+
[&](const uint8_t *in, uint8_t *out, size_t len) {
|
|
400
|
+
size_t len_whole = (len / AES_BLOCK_SIZE) * AES_BLOCK_SIZE;
|
|
401
|
+
if (len_whole != 0) {
|
|
402
|
+
if (len_whole >= 128) {
|
|
403
|
+
aes128gcmsiv_enc_msg_x8(in, out, counter, &enc_key_expanded,
|
|
404
|
+
len_whole);
|
|
405
|
+
} else {
|
|
406
|
+
aes128gcmsiv_enc_msg_x4(in, out, counter, &enc_key_expanded,
|
|
407
|
+
len_whole);
|
|
408
|
+
}
|
|
409
|
+
in += len_whole;
|
|
410
|
+
out += len_whole;
|
|
411
|
+
len -= len_whole;
|
|
412
|
+
}
|
|
413
|
+
if (len != 0) {
|
|
414
|
+
aead_aes_gcm_siv_asm_crypt_last_block(
|
|
415
|
+
/*is_128_bit=*/true, /*out_last_block=*/out,
|
|
416
|
+
/*in_last_block=*/in, /*total_in_len=*/in_len, tag,
|
|
417
|
+
&enc_key_expanded);
|
|
418
|
+
}
|
|
419
|
+
return true;
|
|
420
|
+
});
|
|
376
421
|
} else {
|
|
377
422
|
aes256gcmsiv_aes_ks_enc_x1(tag, tag, &enc_key_expanded.key[0],
|
|
378
423
|
record_enc_key);
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
424
|
+
alignas(16) uint8_t counter[16];
|
|
425
|
+
OPENSSL_memcpy(counter, tag, 16);
|
|
426
|
+
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/true>(
|
|
427
|
+
iovecs,
|
|
428
|
+
[&](const uint8_t *in, uint8_t *out, size_t len) {
|
|
429
|
+
if (len >= 128) {
|
|
430
|
+
aes256gcmsiv_enc_msg_x8(in, out, counter, &enc_key_expanded, len);
|
|
431
|
+
} else {
|
|
432
|
+
aes256gcmsiv_enc_msg_x4(in, out, counter, &enc_key_expanded, len);
|
|
433
|
+
}
|
|
434
|
+
inc_counter(counter, static_cast<uint32_t>(len / AES_BLOCK_SIZE));
|
|
435
|
+
return true;
|
|
436
|
+
},
|
|
437
|
+
[&](const uint8_t *in, uint8_t *out, size_t len) {
|
|
438
|
+
size_t len_whole = (len / AES_BLOCK_SIZE) * AES_BLOCK_SIZE;
|
|
439
|
+
if (len_whole != 0) {
|
|
440
|
+
if (len_whole >= 128) {
|
|
441
|
+
aes256gcmsiv_enc_msg_x8(in, out, counter, &enc_key_expanded,
|
|
442
|
+
len_whole);
|
|
443
|
+
} else {
|
|
444
|
+
aes256gcmsiv_enc_msg_x4(in, out, counter, &enc_key_expanded,
|
|
445
|
+
len_whole);
|
|
446
|
+
}
|
|
447
|
+
in += len_whole;
|
|
448
|
+
out += len_whole;
|
|
449
|
+
len -= len_whole;
|
|
450
|
+
}
|
|
451
|
+
if (len != 0) {
|
|
452
|
+
aead_aes_gcm_siv_asm_crypt_last_block(
|
|
453
|
+
/*is_128_bit=*/false, /*out_last_block=*/out,
|
|
454
|
+
/*in_last_block=*/in, /*total_in_len=*/in_len, tag,
|
|
455
|
+
&enc_key_expanded);
|
|
456
|
+
}
|
|
457
|
+
return true;
|
|
458
|
+
});
|
|
385
459
|
}
|
|
386
460
|
|
|
387
|
-
|
|
388
|
-
aead_aes_gcm_siv_asm_crypt_last_block(gcm_siv_ctx->is_128_bit, out, in,
|
|
389
|
-
in_len, tag, &enc_key_expanded);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
OPENSSL_memcpy(out_tag, tag, sizeof(tag));
|
|
461
|
+
CopyToPrefix(tag, out_tag);
|
|
393
462
|
*out_tag_len = EVP_AEAD_AES_GCM_SIV_TAG_LEN;
|
|
394
463
|
|
|
395
464
|
return 1;
|
|
396
465
|
}
|
|
397
466
|
|
|
398
|
-
int
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
467
|
+
int aead_aes_gcm_siv_asm_openv_detached(const EVP_AEAD_CTX *ctx,
|
|
468
|
+
Span<const CRYPTO_IOVEC> iovecs,
|
|
469
|
+
Span<const uint8_t> nonce,
|
|
470
|
+
Span<const uint8_t> in_tag,
|
|
471
|
+
Span<const CRYPTO_IVEC> aadvecs) {
|
|
472
|
+
const size_t ad_len = bssl::iovec::TotalLength(aadvecs);
|
|
403
473
|
const uint64_t ad_len_64 = ad_len;
|
|
404
474
|
if (ad_len_64 >= (UINT64_C(1) << 61)) {
|
|
405
475
|
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE);
|
|
406
476
|
return 0;
|
|
407
477
|
}
|
|
408
478
|
|
|
479
|
+
const size_t in_len = bssl::iovec::TotalLength(iovecs);
|
|
409
480
|
const uint64_t in_len_64 = in_len;
|
|
410
481
|
if (in_len_64 > UINT64_C(1) << 36 ||
|
|
411
|
-
|
|
482
|
+
in_tag.size() != EVP_AEAD_AES_GCM_SIV_TAG_LEN) {
|
|
412
483
|
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT);
|
|
413
484
|
return 0;
|
|
414
485
|
}
|
|
415
486
|
|
|
416
|
-
if (
|
|
487
|
+
if (nonce.size() != EVP_AEAD_AES_GCM_SIV_NONCE_LEN) {
|
|
417
488
|
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE);
|
|
418
489
|
return 0;
|
|
419
490
|
}
|
|
@@ -423,7 +494,7 @@ int aead_aes_gcm_siv_asm_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out,
|
|
|
423
494
|
alignas(16) uint64_t record_auth_key[2];
|
|
424
495
|
alignas(16) uint64_t record_enc_key[4];
|
|
425
496
|
aead_aes_gcm_siv_kdf(gcm_siv_ctx->is_128_bit, gcm_siv_ctx, record_auth_key,
|
|
426
|
-
record_enc_key, nonce);
|
|
497
|
+
record_enc_key, nonce.data());
|
|
427
498
|
|
|
428
499
|
struct aead_aes_gcm_siv_asm_ctx expanded_key;
|
|
429
500
|
if (gcm_siv_ctx->is_128_bit) {
|
|
@@ -436,38 +507,87 @@ int aead_aes_gcm_siv_asm_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out,
|
|
|
436
507
|
alignas(16) uint8_t calculated_tag[16 * 8] = {0};
|
|
437
508
|
|
|
438
509
|
OPENSSL_memset(calculated_tag, 0, EVP_AEAD_AES_GCM_SIV_TAG_LEN);
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
510
|
+
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(
|
|
511
|
+
aadvecs,
|
|
512
|
+
[&](const uint8_t *in, size_t len) {
|
|
513
|
+
aesgcmsiv_polyval_horner(calculated_tag,
|
|
514
|
+
(const uint8_t *)record_auth_key, in,
|
|
515
|
+
len / AES_BLOCK_SIZE);
|
|
516
|
+
return true;
|
|
517
|
+
},
|
|
518
|
+
[&](const uint8_t *in, size_t len) {
|
|
519
|
+
size_t len_whole = (len / AES_BLOCK_SIZE) * AES_BLOCK_SIZE;
|
|
520
|
+
if (len_whole != 0) {
|
|
521
|
+
aesgcmsiv_polyval_horner(calculated_tag,
|
|
522
|
+
(const uint8_t *)record_auth_key, in,
|
|
523
|
+
len_whole / AES_BLOCK_SIZE);
|
|
524
|
+
in += len_whole;
|
|
525
|
+
len -= len_whole;
|
|
526
|
+
}
|
|
527
|
+
if (len != 0) {
|
|
528
|
+
uint8_t pad_buf[AES_BLOCK_SIZE];
|
|
529
|
+
OPENSSL_memcpy(pad_buf, in, len);
|
|
530
|
+
OPENSSL_memset(pad_buf + len, 0, AES_BLOCK_SIZE - len);
|
|
531
|
+
aesgcmsiv_polyval_horner(
|
|
532
|
+
calculated_tag, (const uint8_t *)record_auth_key, pad_buf, 1);
|
|
533
|
+
}
|
|
534
|
+
return true;
|
|
535
|
+
});
|
|
450
536
|
|
|
451
537
|
alignas(16) uint8_t htable[16 * 6];
|
|
452
538
|
aesgcmsiv_htable6_init(htable, (const uint8_t *)record_auth_key);
|
|
453
539
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
540
|
+
size_t blocks = 0;
|
|
541
|
+
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/true>(
|
|
542
|
+
iovecs,
|
|
543
|
+
[&](const uint8_t *in, uint8_t *out, size_t len) {
|
|
544
|
+
// aes[128|256]gcmsiv_dec needs access to the claimed tag. So it's put
|
|
545
|
+
// into its scratch space. The function may clobber the claimed tag, so
|
|
546
|
+
// this is copied before each call.
|
|
547
|
+
OPENSSL_memcpy(calculated_tag + 16, in_tag.data(),
|
|
548
|
+
EVP_AEAD_AES_GCM_SIV_TAG_LEN);
|
|
549
|
+
inc_counter(calculated_tag + 16, static_cast<uint32_t>(blocks));
|
|
550
|
+
if (gcm_siv_ctx->is_128_bit) {
|
|
551
|
+
aes128gcmsiv_dec(in, out, calculated_tag, htable, &expanded_key, len);
|
|
552
|
+
} else {
|
|
553
|
+
aes256gcmsiv_dec(in, out, calculated_tag, htable, &expanded_key, len);
|
|
554
|
+
}
|
|
555
|
+
blocks += len / AES_BLOCK_SIZE;
|
|
556
|
+
return true;
|
|
557
|
+
},
|
|
558
|
+
[&](const uint8_t *in, uint8_t *out, size_t len) {
|
|
559
|
+
size_t len_whole = (len / AES_BLOCK_SIZE) * AES_BLOCK_SIZE;
|
|
560
|
+
if (len_whole != 0) {
|
|
561
|
+
// aes[128|256]gcmsiv_dec needs access to the claimed tag. So it's put
|
|
562
|
+
// into its scratch space. The function may clobber the claimed tag,
|
|
563
|
+
// so this is copied before each call.
|
|
564
|
+
OPENSSL_memcpy(calculated_tag + 16, in_tag.data(),
|
|
565
|
+
EVP_AEAD_AES_GCM_SIV_TAG_LEN);
|
|
566
|
+
inc_counter(calculated_tag + 16, static_cast<uint32_t>(blocks));
|
|
567
|
+
if (gcm_siv_ctx->is_128_bit) {
|
|
568
|
+
aes128gcmsiv_dec(in, out, calculated_tag, htable, &expanded_key,
|
|
569
|
+
len_whole);
|
|
570
|
+
} else {
|
|
571
|
+
aes256gcmsiv_dec(in, out, calculated_tag, htable, &expanded_key,
|
|
572
|
+
len_whole);
|
|
573
|
+
}
|
|
574
|
+
in += len_whole;
|
|
575
|
+
out += len_whole;
|
|
576
|
+
len -= len_whole;
|
|
577
|
+
}
|
|
578
|
+
if (len != 0) {
|
|
579
|
+
aead_aes_gcm_siv_asm_crypt_last_block(
|
|
580
|
+
gcm_siv_ctx->is_128_bit, /*out_last_block=*/out,
|
|
581
|
+
/*in_last_block=*/in, /*total_in_len=*/in_len, in_tag.data(),
|
|
582
|
+
&expanded_key);
|
|
583
|
+
uint8_t pad_buf[AES_BLOCK_SIZE];
|
|
584
|
+
OPENSSL_memcpy(pad_buf, out, len);
|
|
585
|
+
OPENSSL_memset(pad_buf + len, 0, AES_BLOCK_SIZE - len);
|
|
586
|
+
aesgcmsiv_polyval_horner(
|
|
587
|
+
calculated_tag, (const uint8_t *)record_auth_key, pad_buf, 1);
|
|
588
|
+
}
|
|
589
|
+
return true;
|
|
590
|
+
});
|
|
471
591
|
|
|
472
592
|
uint8_t length_block[16];
|
|
473
593
|
CRYPTO_store_u64_le(length_block, ad_len * 8);
|
|
@@ -487,8 +607,8 @@ int aead_aes_gcm_siv_asm_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out,
|
|
|
487
607
|
aes256gcmsiv_ecb_enc_block(calculated_tag, calculated_tag, &expanded_key);
|
|
488
608
|
}
|
|
489
609
|
|
|
490
|
-
if (CRYPTO_memcmp(calculated_tag, in_tag,
|
|
491
|
-
|
|
610
|
+
if (CRYPTO_memcmp(calculated_tag, in_tag.data(),
|
|
611
|
+
EVP_AEAD_AES_GCM_SIV_TAG_LEN) != 0) {
|
|
492
612
|
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT);
|
|
493
613
|
return 0;
|
|
494
614
|
}
|
|
@@ -501,16 +621,15 @@ const EVP_AEAD aead_aes_128_gcm_siv_asm = {
|
|
|
501
621
|
EVP_AEAD_AES_GCM_SIV_NONCE_LEN, // nonce length
|
|
502
622
|
EVP_AEAD_AES_GCM_SIV_TAG_LEN, // overhead
|
|
503
623
|
EVP_AEAD_AES_GCM_SIV_TAG_LEN, // max tag length
|
|
504
|
-
0, // seal_scatter_supports_extra_in
|
|
505
624
|
|
|
506
625
|
aead_aes_gcm_siv_asm_init,
|
|
507
|
-
|
|
626
|
+
nullptr /* init_with_direction */,
|
|
508
627
|
aead_aes_gcm_siv_asm_cleanup,
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
628
|
+
nullptr /* openv */,
|
|
629
|
+
aead_aes_gcm_siv_asm_sealv,
|
|
630
|
+
aead_aes_gcm_siv_asm_openv_detached,
|
|
631
|
+
nullptr /* get_iv */,
|
|
632
|
+
nullptr /* tag_len */,
|
|
514
633
|
};
|
|
515
634
|
|
|
516
635
|
const EVP_AEAD aead_aes_256_gcm_siv_asm = {
|
|
@@ -518,16 +637,15 @@ const EVP_AEAD aead_aes_256_gcm_siv_asm = {
|
|
|
518
637
|
EVP_AEAD_AES_GCM_SIV_NONCE_LEN, // nonce length
|
|
519
638
|
EVP_AEAD_AES_GCM_SIV_TAG_LEN, // overhead
|
|
520
639
|
EVP_AEAD_AES_GCM_SIV_TAG_LEN, // max tag length
|
|
521
|
-
0, // seal_scatter_supports_extra_in
|
|
522
640
|
|
|
523
641
|
aead_aes_gcm_siv_asm_init,
|
|
524
|
-
|
|
642
|
+
nullptr /* init_with_direction */,
|
|
525
643
|
aead_aes_gcm_siv_asm_cleanup,
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
644
|
+
nullptr /* openv */,
|
|
645
|
+
aead_aes_gcm_siv_asm_sealv,
|
|
646
|
+
aead_aes_gcm_siv_asm_openv_detached,
|
|
647
|
+
nullptr /* get_iv */,
|
|
648
|
+
nullptr /* tag_len */,
|
|
531
649
|
};
|
|
532
650
|
|
|
533
651
|
#endif // X86_64 && !NO_ASM && !WINDOWS
|
|
@@ -542,7 +660,7 @@ struct aead_aes_gcm_siv_ctx {
|
|
|
542
660
|
unsigned is_256 : 1;
|
|
543
661
|
};
|
|
544
662
|
|
|
545
|
-
static_assert(sizeof(((EVP_AEAD_CTX *)
|
|
663
|
+
static_assert(sizeof(((EVP_AEAD_CTX *)nullptr)->state) >=
|
|
546
664
|
sizeof(struct aead_aes_gcm_siv_ctx),
|
|
547
665
|
"AEAD state is too small");
|
|
548
666
|
static_assert(alignof(union evp_aead_ctx_st_state) >=
|
|
@@ -570,7 +688,7 @@ int aead_aes_gcm_siv_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len,
|
|
|
570
688
|
(struct aead_aes_gcm_siv_ctx *)&ctx->state;
|
|
571
689
|
OPENSSL_memset(gcm_siv_ctx, 0, sizeof(struct aead_aes_gcm_siv_ctx));
|
|
572
690
|
|
|
573
|
-
aes_ctr_set_key(&gcm_siv_ctx->ks.ks,
|
|
691
|
+
aes_ctr_set_key(&gcm_siv_ctx->ks.ks, nullptr, &gcm_siv_ctx->kgk_block, key,
|
|
574
692
|
key_len);
|
|
575
693
|
gcm_siv_ctx->is_256 = (key_len == 32);
|
|
576
694
|
ctx->tag_len = tag_len;
|
|
@@ -580,14 +698,14 @@ int aead_aes_gcm_siv_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len,
|
|
|
580
698
|
|
|
581
699
|
void aead_aes_gcm_siv_cleanup(EVP_AEAD_CTX *ctx) {}
|
|
582
700
|
|
|
583
|
-
// gcm_siv_crypt encrypts (or decrypts—it's the same thing)
|
|
584
|
-
//
|
|
585
|
-
// mode, starting at
|
|
586
|
-
// counter mode code in that the counter is handled little-endian,
|
|
587
|
-
// first four bytes are used and the GCM-SIV tweak to the final byte
|
|
588
|
-
// applied. The
|
|
701
|
+
// gcm_siv_crypt encrypts (or decrypts—it's the same thing) bytes from `in` to
|
|
702
|
+
// `out` in the `iovec`, using the block function `enc_block` with `key` in
|
|
703
|
+
// counter mode, starting at `initial_counter`. This differs from the
|
|
704
|
+
// traditional counter mode code in that the counter is handled little-endian,
|
|
705
|
+
// only the first four bytes are used and the GCM-SIV tweak to the final byte
|
|
706
|
+
// is applied. The `in` and `out` pointers may be equal but otherwise must not
|
|
589
707
|
// alias.
|
|
590
|
-
void gcm_siv_crypt(
|
|
708
|
+
void gcm_siv_crypt(Span<const CRYPTO_IOVEC> iovecs,
|
|
591
709
|
const uint8_t initial_counter[AES_BLOCK_SIZE],
|
|
592
710
|
block128_f enc_block, const AES_KEY *key) {
|
|
593
711
|
uint8_t counter[16];
|
|
@@ -595,22 +713,28 @@ void gcm_siv_crypt(uint8_t *out, const uint8_t *in, size_t in_len,
|
|
|
595
713
|
OPENSSL_memcpy(counter, initial_counter, AES_BLOCK_SIZE);
|
|
596
714
|
counter[15] |= 0x80;
|
|
597
715
|
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
716
|
+
auto crypt_bytes = [&](const uint8_t *in, uint8_t *out, size_t len) {
|
|
717
|
+
for (size_t done = 0; done < len;) {
|
|
718
|
+
uint8_t keystream[AES_BLOCK_SIZE];
|
|
719
|
+
enc_block(counter, keystream, key);
|
|
720
|
+
inc_counter(counter, 1);
|
|
602
721
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
722
|
+
size_t todo = AES_BLOCK_SIZE;
|
|
723
|
+
if (len - done < todo) {
|
|
724
|
+
todo = len - done;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
for (size_t i = 0; i < todo; i++) {
|
|
728
|
+
out[done + i] = keystream[i] ^ in[done + i];
|
|
729
|
+
}
|
|
607
730
|
|
|
608
|
-
|
|
609
|
-
out[done + i] = keystream[i] ^ in[done + i];
|
|
731
|
+
done += todo;
|
|
610
732
|
}
|
|
733
|
+
return true;
|
|
734
|
+
};
|
|
611
735
|
|
|
612
|
-
|
|
613
|
-
|
|
736
|
+
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/true>(
|
|
737
|
+
iovecs, crypt_bytes, crypt_bytes);
|
|
614
738
|
}
|
|
615
739
|
|
|
616
740
|
|
|
@@ -633,7 +757,7 @@ struct polyval_ctx {
|
|
|
633
757
|
ghash_func ghash;
|
|
634
758
|
};
|
|
635
759
|
|
|
636
|
-
// byte_reverse reverses the order of the bytes in
|
|
760
|
+
// byte_reverse reverses the order of the bytes in `b->c`.
|
|
637
761
|
void byte_reverse(uint8_t b[16]) {
|
|
638
762
|
uint64_t hi = CRYPTO_load_u64_le(b);
|
|
639
763
|
uint64_t lo = CRYPTO_load_u64_le(b + 8);
|
|
@@ -641,8 +765,8 @@ void byte_reverse(uint8_t b[16]) {
|
|
|
641
765
|
CRYPTO_store_u64_le(b + 8, CRYPTO_bswap8(hi));
|
|
642
766
|
}
|
|
643
767
|
|
|
644
|
-
// reverse_and_mulX_ghash interprets
|
|
645
|
-
// field, multiplies that by 'x' and serialises the result back into
|
|
768
|
+
// reverse_and_mulX_ghash interprets `b` as a reversed element of the GHASH
|
|
769
|
+
// field, multiplies that by 'x' and serialises the result back into `b`, but
|
|
646
770
|
// with GHASH's backwards bit ordering.
|
|
647
771
|
void reverse_and_mulX_ghash(uint8_t b[16]) {
|
|
648
772
|
uint64_t hi = CRYPTO_load_u64_le(b);
|
|
@@ -694,34 +818,50 @@ void crypto_polyval_finish(const struct polyval_ctx *ctx, uint8_t out[16]) {
|
|
|
694
818
|
byte_reverse(out);
|
|
695
819
|
}
|
|
696
820
|
|
|
697
|
-
// gcm_siv_polyval evaluates POLYVAL at
|
|
698
|
-
// AD. The result is written to
|
|
699
|
-
void gcm_siv_polyval(uint8_t out_tag[16], const
|
|
700
|
-
|
|
821
|
+
// gcm_siv_polyval evaluates POLYVAL at `auth_key` on the given plaintext and
|
|
822
|
+
// AD. The result is written to `out_tag`.
|
|
823
|
+
void gcm_siv_polyval(uint8_t out_tag[16], Span<const CRYPTO_IOVEC> iovecs,
|
|
824
|
+
bool encrypt, Span<const CRYPTO_IVEC> aadvecs,
|
|
701
825
|
const uint8_t auth_key[16],
|
|
702
826
|
const uint8_t nonce[EVP_AEAD_AES_GCM_SIV_NONCE_LEN]) {
|
|
703
827
|
struct polyval_ctx polyval_ctx;
|
|
704
828
|
crypto_polyval_init(&polyval_ctx, auth_key);
|
|
705
829
|
|
|
706
|
-
|
|
830
|
+
auto f_whole = [&](const uint8_t *in, size_t len) {
|
|
831
|
+
crypto_polyval_update_blocks(&polyval_ctx, in, len);
|
|
832
|
+
return true;
|
|
833
|
+
};
|
|
834
|
+
auto f_final = [&](const uint8_t *in, size_t len) {
|
|
835
|
+
size_t len_whole = (len / AES_BLOCK_SIZE) * AES_BLOCK_SIZE;
|
|
836
|
+
if (len_whole != 0) {
|
|
837
|
+
crypto_polyval_update_blocks(&polyval_ctx, in, len_whole);
|
|
838
|
+
in += len_whole;
|
|
839
|
+
len -= len_whole;
|
|
840
|
+
}
|
|
841
|
+
if (len != 0) {
|
|
842
|
+
uint8_t pad_buf[AES_BLOCK_SIZE];
|
|
843
|
+
OPENSSL_memcpy(pad_buf, in, len);
|
|
844
|
+
OPENSSL_memset(pad_buf + len, 0, AES_BLOCK_SIZE - len);
|
|
845
|
+
crypto_polyval_update_blocks(&polyval_ctx, pad_buf, AES_BLOCK_SIZE);
|
|
846
|
+
}
|
|
847
|
+
return true;
|
|
848
|
+
};
|
|
707
849
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
OPENSSL_memset(scratch, 0, sizeof(scratch));
|
|
711
|
-
OPENSSL_memcpy(scratch, &ad[ad_len & ~15], ad_len & 15);
|
|
712
|
-
crypto_polyval_update_blocks(&polyval_ctx, scratch, sizeof(scratch));
|
|
713
|
-
}
|
|
850
|
+
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(aadvecs, f_whole,
|
|
851
|
+
f_final);
|
|
714
852
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
853
|
+
if (encrypt) {
|
|
854
|
+
bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(
|
|
855
|
+
iovecs, f_whole, f_final);
|
|
856
|
+
} else {
|
|
857
|
+
bssl::iovec::ForEachOutBlockRange<AES_BLOCK_SIZE>(iovecs, f_whole, f_final);
|
|
720
858
|
}
|
|
721
859
|
|
|
722
860
|
uint8_t length_block[16];
|
|
723
|
-
CRYPTO_store_u64_le(length_block,
|
|
724
|
-
|
|
861
|
+
CRYPTO_store_u64_le(length_block,
|
|
862
|
+
((uint64_t)bssl::iovec::TotalLength(aadvecs)) * 8);
|
|
863
|
+
CRYPTO_store_u64_le(length_block + 8,
|
|
864
|
+
((uint64_t)bssl::iovec::TotalLength(iovecs)) * 8);
|
|
725
865
|
crypto_polyval_update_blocks(&polyval_ctx, length_block,
|
|
726
866
|
sizeof(length_block));
|
|
727
867
|
|
|
@@ -743,7 +883,7 @@ struct gcm_siv_record_keys {
|
|
|
743
883
|
};
|
|
744
884
|
|
|
745
885
|
// gcm_siv_keys calculates the keys for a specific GCM-SIV record with the
|
|
746
|
-
// given nonce and writes them to
|
|
886
|
+
// given nonce and writes them to `*out_keys`.
|
|
747
887
|
void gcm_siv_keys(const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx,
|
|
748
888
|
struct gcm_siv_record_keys *out_keys,
|
|
749
889
|
const uint8_t nonce[EVP_AEAD_AES_GCM_SIV_NONCE_LEN]) {
|
|
@@ -764,27 +904,27 @@ void gcm_siv_keys(const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx,
|
|
|
764
904
|
}
|
|
765
905
|
|
|
766
906
|
OPENSSL_memcpy(out_keys->auth_key, key_material, 16);
|
|
767
|
-
// Note the
|
|
907
|
+
// Note the `ctr128_f` function uses a big-endian couner, while AES-GCM-SIV
|
|
768
908
|
// uses a little-endian counter. We ignore the return value and only use
|
|
769
|
-
//
|
|
909
|
+
// `block128_f`. This has a significant performance cost for the fallback
|
|
770
910
|
// bitsliced AES implementations (bsaes and aes_nohw).
|
|
771
911
|
//
|
|
772
912
|
// We currently do not consider AES-GCM-SIV to be performance-sensitive on
|
|
773
|
-
// client hardware. If this changes, we can write little-endian
|
|
913
|
+
// client hardware. If this changes, we can write little-endian `ctr128_f`
|
|
774
914
|
// functions.
|
|
775
|
-
aes_ctr_set_key(&out_keys->enc_key.ks,
|
|
915
|
+
aes_ctr_set_key(&out_keys->enc_key.ks, nullptr, &out_keys->enc_block,
|
|
776
916
|
key_material + 16, gcm_siv_ctx->is_256 ? 32 : 16);
|
|
777
917
|
}
|
|
778
918
|
|
|
779
|
-
int
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
size_t extra_in_len, const uint8_t *ad,
|
|
785
|
-
size_t ad_len) {
|
|
919
|
+
int aead_aes_gcm_siv_sealv(const EVP_AEAD_CTX *ctx,
|
|
920
|
+
Span<const CRYPTO_IOVEC> iovecs,
|
|
921
|
+
Span<uint8_t> out_tag, size_t *out_tag_len,
|
|
922
|
+
Span<const uint8_t> nonce,
|
|
923
|
+
Span<const CRYPTO_IVEC> aadvecs) {
|
|
786
924
|
const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx =
|
|
787
925
|
(struct aead_aes_gcm_siv_ctx *)&ctx->state;
|
|
926
|
+
size_t in_len = bssl::iovec::TotalLength(iovecs);
|
|
927
|
+
size_t ad_len = bssl::iovec::TotalLength(aadvecs);
|
|
788
928
|
const uint64_t in_len_64 = in_len;
|
|
789
929
|
const uint64_t ad_len_64 = ad_len;
|
|
790
930
|
|
|
@@ -794,50 +934,50 @@ int aead_aes_gcm_siv_seal_scatter(const EVP_AEAD_CTX *ctx, uint8_t *out,
|
|
|
794
934
|
return 0;
|
|
795
935
|
}
|
|
796
936
|
|
|
797
|
-
if (
|
|
937
|
+
if (out_tag.size() < EVP_AEAD_AES_GCM_SIV_TAG_LEN) {
|
|
798
938
|
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL);
|
|
799
939
|
return 0;
|
|
800
940
|
}
|
|
801
941
|
|
|
802
|
-
if (
|
|
942
|
+
if (nonce.size() != EVP_AEAD_AES_GCM_SIV_NONCE_LEN) {
|
|
803
943
|
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE);
|
|
804
944
|
return 0;
|
|
805
945
|
}
|
|
806
946
|
|
|
807
947
|
struct gcm_siv_record_keys keys;
|
|
808
|
-
gcm_siv_keys(gcm_siv_ctx, &keys, nonce);
|
|
948
|
+
gcm_siv_keys(gcm_siv_ctx, &keys, nonce.data());
|
|
809
949
|
|
|
810
|
-
uint8_t tag[
|
|
811
|
-
gcm_siv_polyval(tag,
|
|
950
|
+
uint8_t tag[EVP_AEAD_AES_GCM_SIV_TAG_LEN];
|
|
951
|
+
gcm_siv_polyval(tag, iovecs, true, aadvecs, keys.auth_key, nonce.data());
|
|
812
952
|
keys.enc_block(tag, tag, &keys.enc_key.ks);
|
|
813
953
|
|
|
814
|
-
gcm_siv_crypt(
|
|
954
|
+
gcm_siv_crypt(iovecs, tag, keys.enc_block, &keys.enc_key.ks);
|
|
815
955
|
|
|
816
|
-
|
|
956
|
+
CopyToPrefix(tag, out_tag);
|
|
817
957
|
*out_tag_len = EVP_AEAD_AES_GCM_SIV_TAG_LEN;
|
|
818
958
|
|
|
819
959
|
return 1;
|
|
820
960
|
}
|
|
821
961
|
|
|
822
|
-
int
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
const uint64_t ad_len_64 =
|
|
962
|
+
int aead_aes_gcm_siv_openv_detached(const EVP_AEAD_CTX *ctx,
|
|
963
|
+
Span<const CRYPTO_IOVEC> iovecs,
|
|
964
|
+
Span<const uint8_t> nonce,
|
|
965
|
+
Span<const uint8_t> in_tag,
|
|
966
|
+
Span<const CRYPTO_IVEC> aadvecs) {
|
|
967
|
+
const uint64_t ad_len_64 = bssl::iovec::TotalLength(aadvecs);
|
|
828
968
|
if (ad_len_64 >= (UINT64_C(1) << 61)) {
|
|
829
969
|
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE);
|
|
830
970
|
return 0;
|
|
831
971
|
}
|
|
832
972
|
|
|
833
|
-
const uint64_t in_len_64 =
|
|
834
|
-
if (
|
|
835
|
-
in_len_64 > (UINT64_C(1) << 36)
|
|
973
|
+
const uint64_t in_len_64 = bssl::iovec::TotalLength(iovecs);
|
|
974
|
+
if (in_tag.size() != EVP_AEAD_AES_GCM_SIV_TAG_LEN ||
|
|
975
|
+
in_len_64 > (UINT64_C(1) << 36)) {
|
|
836
976
|
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT);
|
|
837
977
|
return 0;
|
|
838
978
|
}
|
|
839
979
|
|
|
840
|
-
if (
|
|
980
|
+
if (nonce.size() != EVP_AEAD_AES_GCM_SIV_NONCE_LEN) {
|
|
841
981
|
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE);
|
|
842
982
|
return 0;
|
|
843
983
|
}
|
|
@@ -846,15 +986,16 @@ int aead_aes_gcm_siv_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out,
|
|
|
846
986
|
(struct aead_aes_gcm_siv_ctx *)&ctx->state;
|
|
847
987
|
|
|
848
988
|
struct gcm_siv_record_keys keys;
|
|
849
|
-
gcm_siv_keys(gcm_siv_ctx, &keys, nonce);
|
|
989
|
+
gcm_siv_keys(gcm_siv_ctx, &keys, nonce.data());
|
|
850
990
|
|
|
851
|
-
gcm_siv_crypt(
|
|
991
|
+
gcm_siv_crypt(iovecs, in_tag.data(), keys.enc_block, &keys.enc_key.ks);
|
|
852
992
|
|
|
853
993
|
uint8_t expected_tag[EVP_AEAD_AES_GCM_SIV_TAG_LEN];
|
|
854
|
-
gcm_siv_polyval(expected_tag,
|
|
994
|
+
gcm_siv_polyval(expected_tag, iovecs, false, aadvecs, keys.auth_key,
|
|
995
|
+
nonce.data());
|
|
855
996
|
keys.enc_block(expected_tag, expected_tag, &keys.enc_key.ks);
|
|
856
997
|
|
|
857
|
-
if (CRYPTO_memcmp(expected_tag, in_tag, sizeof(expected_tag)) != 0) {
|
|
998
|
+
if (CRYPTO_memcmp(expected_tag, in_tag.data(), sizeof(expected_tag)) != 0) {
|
|
858
999
|
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT);
|
|
859
1000
|
return 0;
|
|
860
1001
|
}
|
|
@@ -867,16 +1008,15 @@ const EVP_AEAD aead_aes_128_gcm_siv = {
|
|
|
867
1008
|
EVP_AEAD_AES_GCM_SIV_NONCE_LEN, // nonce length
|
|
868
1009
|
EVP_AEAD_AES_GCM_SIV_TAG_LEN, // overhead
|
|
869
1010
|
EVP_AEAD_AES_GCM_SIV_TAG_LEN, // max tag length
|
|
870
|
-
0, // seal_scatter_supports_extra_in
|
|
871
1011
|
|
|
872
1012
|
aead_aes_gcm_siv_init,
|
|
873
|
-
|
|
1013
|
+
nullptr /* init_with_direction */,
|
|
874
1014
|
aead_aes_gcm_siv_cleanup,
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
1015
|
+
nullptr /* openv */,
|
|
1016
|
+
aead_aes_gcm_siv_sealv,
|
|
1017
|
+
aead_aes_gcm_siv_openv_detached,
|
|
1018
|
+
nullptr /* get_iv */,
|
|
1019
|
+
nullptr /* tag_len */,
|
|
880
1020
|
};
|
|
881
1021
|
|
|
882
1022
|
const EVP_AEAD aead_aes_256_gcm_siv = {
|
|
@@ -884,30 +1024,31 @@ const EVP_AEAD aead_aes_256_gcm_siv = {
|
|
|
884
1024
|
EVP_AEAD_AES_GCM_SIV_NONCE_LEN, // nonce length
|
|
885
1025
|
EVP_AEAD_AES_GCM_SIV_TAG_LEN, // overhead
|
|
886
1026
|
EVP_AEAD_AES_GCM_SIV_TAG_LEN, // max tag length
|
|
887
|
-
0, // seal_scatter_supports_extra_in
|
|
888
1027
|
|
|
889
1028
|
aead_aes_gcm_siv_init,
|
|
890
|
-
|
|
1029
|
+
nullptr /* init_with_direction */,
|
|
891
1030
|
aead_aes_gcm_siv_cleanup,
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1031
|
+
nullptr /* openv */,
|
|
1032
|
+
aead_aes_gcm_siv_sealv,
|
|
1033
|
+
aead_aes_gcm_siv_openv_detached,
|
|
1034
|
+
nullptr /* get_iv */,
|
|
1035
|
+
nullptr /* tag_len */,
|
|
897
1036
|
};
|
|
898
1037
|
} // namespace
|
|
899
1038
|
|
|
900
1039
|
#if defined(AES_GCM_SIV_ASM)
|
|
901
1040
|
|
|
902
|
-
const EVP_AEAD *EVP_aead_aes_128_gcm_siv(
|
|
903
|
-
if (CRYPTO_is_AVX_capable() && CRYPTO_is_AESNI_capable()
|
|
1041
|
+
const EVP_AEAD *EVP_aead_aes_128_gcm_siv() {
|
|
1042
|
+
if (CRYPTO_is_AVX_capable() && CRYPTO_is_AESNI_capable() &&
|
|
1043
|
+
CRYPTO_is_PCLMUL_capable()) {
|
|
904
1044
|
return &aead_aes_128_gcm_siv_asm;
|
|
905
1045
|
}
|
|
906
1046
|
return &aead_aes_128_gcm_siv;
|
|
907
1047
|
}
|
|
908
1048
|
|
|
909
|
-
const EVP_AEAD *EVP_aead_aes_256_gcm_siv(
|
|
910
|
-
if (CRYPTO_is_AVX_capable() && CRYPTO_is_AESNI_capable()
|
|
1049
|
+
const EVP_AEAD *EVP_aead_aes_256_gcm_siv() {
|
|
1050
|
+
if (CRYPTO_is_AVX_capable() && CRYPTO_is_AESNI_capable() &&
|
|
1051
|
+
CRYPTO_is_PCLMUL_capable()) {
|
|
911
1052
|
return &aead_aes_256_gcm_siv_asm;
|
|
912
1053
|
}
|
|
913
1054
|
return &aead_aes_256_gcm_siv;
|
|
@@ -915,8 +1056,8 @@ const EVP_AEAD *EVP_aead_aes_256_gcm_siv(void) {
|
|
|
915
1056
|
|
|
916
1057
|
#else
|
|
917
1058
|
|
|
918
|
-
const EVP_AEAD *EVP_aead_aes_128_gcm_siv(
|
|
1059
|
+
const EVP_AEAD *EVP_aead_aes_128_gcm_siv() { return &aead_aes_128_gcm_siv; }
|
|
919
1060
|
|
|
920
|
-
const EVP_AEAD *EVP_aead_aes_256_gcm_siv(
|
|
1061
|
+
const EVP_AEAD *EVP_aead_aes_256_gcm_siv() { return &aead_aes_256_gcm_siv; }
|
|
921
1062
|
|
|
922
1063
|
#endif // AES_GCM_SIV_ASM
|